From 27509c345cb8a4895bf3a93cb4014d012d4a0225 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 1 Jul 2022 13:57:56 -0700 Subject: [PATCH] Update upb to 20220621 (#30156) * Update third_party/upb to e4635f223e7d36dfbea3b722a4ca4807a7e882e2 * Update grpc_deps * Update src/upb/gen_build_yaml.py * Regen projects * Gen_upb_api * Fix missing json files * Fix missing textformat * Fix missing upb/arena * Sanitize * Fix missing port_def * Fix missing array.h --- CMakeLists.txt | 7 + Makefile | 7 + bazel/grpc_deps.bzl | 8 +- config.m4 | 7 + config.w32 | 7 + gRPC-C++.podspec | 32 +- gRPC-Core.podspec | 39 +- grpc.gemspec | 23 +- grpc.gyp | 7 + package.xml | 23 +- .../lb_policy/grpclb/load_balancer_api.cc | 1 + .../lb_policy/grpclb/load_balancer_api.h | 3 +- .../upb-generated/envoy/admin/v3/certs.upb.c | 10 +- .../upb-generated/envoy/admin/v3/certs.upb.h | 40 +- .../envoy/admin/v3/clusters.upb.c | 8 +- .../envoy/admin/v3/clusters.upb.h | 32 +- .../envoy/admin/v3/config_dump.upb.c | 42 +- .../envoy/admin/v3/config_dump.upb.h | 176 +++-- .../envoy/admin/v3/init_dump.upb.c | 4 +- .../envoy/admin/v3/init_dump.upb.h | 16 +- .../envoy/admin/v3/listeners.upb.c | 4 +- .../envoy/admin/v3/listeners.upb.h | 16 +- .../upb-generated/envoy/admin/v3/memory.upb.c | 2 +- .../upb-generated/envoy/admin/v3/memory.upb.h | 8 +- .../envoy/admin/v3/metrics.upb.c | 2 +- .../envoy/admin/v3/metrics.upb.h | 8 +- .../envoy/admin/v3/mutex_stats.upb.h | 8 +- .../envoy/admin/v3/server_info.upb.h | 16 +- .../upb-generated/envoy/admin/v3/tap.upb.c | 2 +- .../upb-generated/envoy/admin/v3/tap.upb.h | 8 +- .../envoy/annotations/resource.upb.c | 2 +- .../envoy/annotations/resource.upb.h | 10 +- .../envoy/config/accesslog/v3/accesslog.upb.c | 28 +- .../envoy/config/accesslog/v3/accesslog.upb.h | 120 ++- .../envoy/config/bootstrap/v3/bootstrap.upb.c | 34 +- .../envoy/config/bootstrap/v3/bootstrap.upb.h | 136 +++- .../config/cluster/v3/circuit_breaker.upb.c | 6 +- .../config/cluster/v3/circuit_breaker.upb.h | 24 +- .../envoy/config/cluster/v3/cluster.upb.c | 42 +- .../envoy/config/cluster/v3/cluster.upb.h | 192 +++-- .../envoy/config/cluster/v3/filter.upb.c | 2 +- .../envoy/config/cluster/v3/filter.upb.h | 8 +- .../config/cluster/v3/outlier_detection.upb.c | 2 +- .../config/cluster/v3/outlier_detection.upb.h | 8 +- .../config/common/matcher/v3/matcher.upb.c | 22 +- .../config/common/matcher/v3/matcher.upb.h | 112 ++- .../envoy/config/core/v3/address.upb.c | 14 +- .../envoy/config/core/v3/address.upb.h | 56 +- .../envoy/config/core/v3/backoff.upb.c | 2 +- .../envoy/config/core/v3/backoff.upb.h | 8 +- .../envoy/config/core/v3/base.upb.c | 36 +- .../envoy/config/core/v3/base.upb.h | 168 +++- .../envoy/config/core/v3/config_source.upb.c | 14 +- .../envoy/config/core/v3/config_source.upb.h | 56 +- .../config/core/v3/event_service_config.upb.c | 2 +- .../config/core/v3/event_service_config.upb.h | 8 +- .../envoy/config/core/v3/extension.upb.c | 2 +- .../envoy/config/core/v3/extension.upb.h | 8 +- .../config/core/v3/grpc_method_list.upb.c | 4 +- .../config/core/v3/grpc_method_list.upb.h | 16 +- .../envoy/config/core/v3/grpc_service.upb.c | 24 +- .../envoy/config/core/v3/grpc_service.upb.h | 104 ++- .../envoy/config/core/v3/health_check.upb.c | 18 +- .../envoy/config/core/v3/health_check.upb.h | 72 +- .../envoy/config/core/v3/http_uri.upb.c | 2 +- .../envoy/config/core/v3/http_uri.upb.h | 8 +- .../envoy/config/core/v3/protocol.upb.c | 30 +- .../envoy/config/core/v3/protocol.upb.h | 128 ++- .../envoy/config/core/v3/proxy_protocol.upb.c | 2 +- .../envoy/config/core/v3/proxy_protocol.upb.h | 8 +- .../envoy/config/core/v3/resolver.upb.c | 4 +- .../envoy/config/core/v3/resolver.upb.h | 16 +- .../envoy/config/core/v3/socket_option.upb.h | 8 +- .../core/v3/substitution_format_string.upb.c | 2 +- .../core/v3/substitution_format_string.upb.h | 8 +- .../config/core/v3/udp_socket_config.upb.c | 2 +- .../config/core/v3/udp_socket_config.upb.h | 8 +- .../envoy/config/endpoint/v3/endpoint.upb.c | 6 +- .../envoy/config/endpoint/v3/endpoint.upb.h | 24 +- .../endpoint/v3/endpoint_components.upb.c | 10 +- .../endpoint/v3/endpoint_components.upb.h | 48 +- .../config/endpoint/v3/load_report.upb.c | 6 +- .../config/endpoint/v3/load_report.upb.h | 40 +- .../config/listener/v3/api_listener.upb.c | 2 +- .../config/listener/v3/api_listener.upb.h | 8 +- .../envoy/config/listener/v3/listener.upb.c | 12 +- .../envoy/config/listener/v3/listener.upb.h | 48 +- .../listener/v3/listener_components.upb.c | 10 +- .../listener/v3/listener_components.upb.h | 56 +- .../config/listener/v3/quic_config.upb.c | 2 +- .../config/listener/v3/quic_config.upb.h | 8 +- .../listener/v3/udp_listener_config.upb.c | 4 +- .../listener/v3/udp_listener_config.upb.h | 16 +- .../config/metrics/v3/metrics_service.upb.c | 2 +- .../config/metrics/v3/metrics_service.upb.h | 8 +- .../envoy/config/metrics/v3/stats.upb.c | 12 +- .../envoy/config/metrics/v3/stats.upb.h | 64 +- .../envoy/config/overload/v3/overload.upb.c | 16 +- .../envoy/config/overload/v3/overload.upb.h | 72 +- .../envoy/config/rbac/v3/rbac.upb.c | 14 +- .../envoy/config/rbac/v3/rbac.upb.h | 56 +- .../envoy/config/route/v3/route.upb.c | 6 +- .../envoy/config/route/v3/route.upb.h | 24 +- .../config/route/v3/route_components.upb.c | 92 +-- .../config/route/v3/route_components.upb.h | 400 +++++++--- .../envoy/config/route/v3/scoped_route.upb.c | 6 +- .../envoy/config/route/v3/scoped_route.upb.h | 24 +- .../envoy/config/tap/v3/common.upb.c | 22 +- .../envoy/config/tap/v3/common.upb.h | 88 ++- .../envoy/config/trace/v3/datadog.upb.c | 2 +- .../envoy/config/trace/v3/datadog.upb.h | 8 +- .../envoy/config/trace/v3/dynamic_ot.upb.c | 2 +- .../envoy/config/trace/v3/dynamic_ot.upb.h | 8 +- .../envoy/config/trace/v3/http_tracer.upb.c | 4 +- .../envoy/config/trace/v3/http_tracer.upb.h | 16 +- .../envoy/config/trace/v3/lightstep.upb.c | 2 +- .../envoy/config/trace/v3/lightstep.upb.h | 8 +- .../envoy/config/trace/v3/opencensus.upb.c | 2 +- .../envoy/config/trace/v3/opencensus.upb.h | 8 +- .../envoy/config/trace/v3/service.upb.c | 2 +- .../envoy/config/trace/v3/service.upb.h | 8 +- .../envoy/config/trace/v3/skywalking.upb.c | 4 +- .../envoy/config/trace/v3/skywalking.upb.h | 16 +- .../envoy/config/trace/v3/xray.upb.c | 4 +- .../envoy/config/trace/v3/xray.upb.h | 16 +- .../envoy/config/trace/v3/zipkin.upb.c | 2 +- .../envoy/config/trace/v3/zipkin.upb.h | 8 +- .../clusters/aggregate/v3/cluster.upb.c | 2 +- .../clusters/aggregate/v3/cluster.upb.h | 8 +- .../filters/common/fault/v3/fault.upb.c | 4 +- .../filters/common/fault/v3/fault.upb.h | 40 +- .../filters/http/fault/v3/fault.upb.c | 4 +- .../filters/http/fault/v3/fault.upb.h | 24 +- .../filters/http/rbac/v3/rbac.upb.c | 4 +- .../filters/http/rbac/v3/rbac.upb.h | 16 +- .../filters/http/router/v3/router.upb.c | 2 +- .../filters/http/router/v3/router.upb.h | 8 +- .../v3/http_connection_manager.upb.c | 38 +- .../v3/http_connection_manager.upb.h | 160 +++- .../ring_hash/v3/ring_hash.upb.h | 8 +- .../wrr_locality/v3/wrr_locality.upb.c | 2 +- .../wrr_locality/v3/wrr_locality.upb.h | 8 +- .../transport_sockets/tls/v3/common.upb.c | 12 +- .../transport_sockets/tls/v3/common.upb.h | 56 +- .../transport_sockets/tls/v3/secret.upb.c | 6 +- .../transport_sockets/tls/v3/secret.upb.h | 24 +- .../transport_sockets/tls/v3/tls.upb.c | 10 +- .../transport_sockets/tls/v3/tls.upb.h | 56 +- .../tls/v3/tls_spiffe_validator_config.upb.c | 4 +- .../tls/v3/tls_spiffe_validator_config.upb.h | 16 +- .../envoy/service/discovery/v3/ads.upb.c | 2 +- .../envoy/service/discovery/v3/ads.upb.h | 8 +- .../service/discovery/v3/discovery.upb.c | 12 +- .../service/discovery/v3/discovery.upb.h | 48 +- .../envoy/service/load_stats/v3/lrs.upb.c | 4 +- .../envoy/service/load_stats/v3/lrs.upb.h | 16 +- .../envoy/service/status/v3/csds.upb.c | 8 +- .../envoy/service/status/v3/csds.upb.h | 40 +- .../envoy/type/http/v3/cookie.upb.c | 2 +- .../envoy/type/http/v3/cookie.upb.h | 8 +- .../type/http/v3/path_transformation.upb.c | 8 +- .../type/http/v3/path_transformation.upb.h | 32 +- .../envoy/type/matcher/v3/http_inputs.upb.c | 8 +- .../envoy/type/matcher/v3/http_inputs.upb.h | 32 +- .../envoy/type/matcher/v3/metadata.upb.c | 4 +- .../envoy/type/matcher/v3/metadata.upb.h | 16 +- .../envoy/type/matcher/v3/node.upb.c | 2 +- .../envoy/type/matcher/v3/node.upb.h | 8 +- .../envoy/type/matcher/v3/number.upb.c | 2 +- .../envoy/type/matcher/v3/number.upb.h | 8 +- .../envoy/type/matcher/v3/path.upb.c | 2 +- .../envoy/type/matcher/v3/path.upb.h | 8 +- .../envoy/type/matcher/v3/regex.upb.c | 6 +- .../envoy/type/matcher/v3/regex.upb.h | 24 +- .../envoy/type/matcher/v3/string.upb.c | 2 +- .../envoy/type/matcher/v3/string.upb.h | 16 +- .../envoy/type/matcher/v3/struct.upb.c | 4 +- .../envoy/type/matcher/v3/struct.upb.h | 16 +- .../envoy/type/matcher/v3/value.upb.c | 6 +- .../envoy/type/matcher/v3/value.upb.h | 24 +- .../envoy/type/metadata/v3/metadata.upb.c | 14 +- .../envoy/type/metadata/v3/metadata.upb.h | 56 +- .../envoy/type/tracing/v3/custom_tag.upb.c | 10 +- .../envoy/type/tracing/v3/custom_tag.upb.h | 40 +- .../envoy/type/v3/hash_policy.upb.c | 6 +- .../envoy/type/v3/hash_policy.upb.h | 24 +- .../envoy/type/v3/http_status.upb.c | 2 +- .../envoy/type/v3/http_status.upb.h | 8 +- .../upb-generated/envoy/type/v3/percent.upb.h | 16 +- .../upb-generated/envoy/type/v3/range.upb.c | 4 +- .../upb-generated/envoy/type/v3/range.upb.h | 24 +- .../envoy/type/v3/semantic_version.upb.c | 2 +- .../envoy/type/v3/semantic_version.upb.h | 8 +- .../envoy/type/v3/token_bucket.upb.h | 8 +- .../google/api/annotations.upb.h | 2 +- .../google/api/expr/v1alpha1/checked.upb.c | 22 +- .../google/api/expr/v1alpha1/checked.upb.h | 88 ++- .../google/api/expr/v1alpha1/syntax.upb.c | 18 +- .../google/api/expr/v1alpha1/syntax.upb.h | 96 ++- .../ext/upb-generated/google/api/http.upb.c | 6 +- .../ext/upb-generated/google/api/http.upb.h | 24 +- .../upb-generated/google/api/httpbody.upb.c | 2 +- .../upb-generated/google/api/httpbody.upb.h | 8 +- .../upb-generated/google/protobuf/any.upb.c | 2 +- .../upb-generated/google/protobuf/any.upb.h | 8 +- .../google/protobuf/descriptor.upb.c | 84 +- .../google/protobuf/descriptor.upb.h | 218 ++++-- .../google/protobuf/duration.upb.c | 2 +- .../google/protobuf/duration.upb.h | 8 +- .../upb-generated/google/protobuf/empty.upb.c | 2 +- .../upb-generated/google/protobuf/empty.upb.h | 8 +- .../google/protobuf/struct.upb.c | 4 +- .../google/protobuf/struct.upb.h | 24 +- .../google/protobuf/timestamp.upb.c | 2 +- .../google/protobuf/timestamp.upb.h | 8 +- .../google/protobuf/wrappers.upb.c | 12 +- .../google/protobuf/wrappers.upb.h | 72 +- .../ext/upb-generated/google/rpc/status.upb.c | 2 +- .../ext/upb-generated/google/rpc/status.upb.h | 8 +- .../ext/upb-generated/google/type/expr.upb.c | 2 +- .../ext/upb-generated/google/type/expr.upb.h | 8 +- .../proto/trace/v1/trace_config.upb.c | 4 +- .../proto/trace/v1/trace_config.upb.h | 32 +- .../src/proto/grpc/gcp/altscontext.upb.h | 8 +- .../src/proto/grpc/gcp/handshaker.upb.c | 14 +- .../src/proto/grpc/gcp/handshaker.upb.h | 80 +- .../grpc/gcp/transport_security_common.upb.c | 2 +- .../grpc/gcp/transport_security_common.upb.h | 16 +- .../src/proto/grpc/health/v1/health.upb.c | 4 +- .../src/proto/grpc/health/v1/health.upb.h | 16 +- .../src/proto/grpc/lb/v1/load_balancer.upb.c | 12 +- .../src/proto/grpc/lb/v1/load_balancer.upb.h | 72 +- .../src/proto/grpc/lookup/v1/rls.upb.c | 4 +- .../src/proto/grpc/lookup/v1/rls.upb.h | 16 +- .../src/proto/grpc/lookup/v1/rls_config.upb.c | 14 +- .../src/proto/grpc/lookup/v1/rls_config.upb.h | 56 +- .../udpa/annotations/migrate.upb.c | 6 +- .../udpa/annotations/migrate.upb.h | 34 +- .../udpa/annotations/security.upb.c | 2 +- .../udpa/annotations/security.upb.h | 10 +- .../udpa/annotations/status.upb.h | 10 +- .../udpa/annotations/versioning.upb.c | 2 +- .../udpa/annotations/versioning.upb.h | 10 +- .../ext/upb-generated/validate/validate.upb.c | 44 +- .../ext/upb-generated/validate/validate.upb.h | 186 +++-- .../xds/annotations/v3/migrate.upb.c | 6 +- .../xds/annotations/v3/migrate.upb.h | 34 +- .../xds/annotations/v3/security.upb.c | 2 +- .../xds/annotations/v3/security.upb.h | 10 +- .../xds/annotations/v3/status.upb.c | 6 +- .../xds/annotations/v3/status.upb.h | 38 +- .../xds/annotations/v3/versioning.upb.c | 2 +- .../xds/annotations/v3/versioning.upb.h | 10 +- .../upb-generated/xds/core/v3/authority.upb.c | 2 +- .../upb-generated/xds/core/v3/authority.upb.h | 8 +- .../xds/core/v3/collection_entry.upb.c | 4 +- .../xds/core/v3/collection_entry.upb.h | 16 +- .../xds/core/v3/context_params.upb.c | 2 +- .../xds/core/v3/context_params.upb.h | 8 +- .../upb-generated/xds/core/v3/extension.upb.c | 2 +- .../upb-generated/xds/core/v3/extension.upb.h | 8 +- .../upb-generated/xds/core/v3/resource.upb.c | 2 +- .../upb-generated/xds/core/v3/resource.upb.h | 8 +- .../xds/core/v3/resource_locator.upb.c | 2 +- .../xds/core/v3/resource_locator.upb.h | 16 +- .../xds/core/v3/resource_name.upb.c | 2 +- .../xds/core/v3/resource_name.upb.h | 8 +- .../xds/data/orca/v3/orca_load_report.upb.h | 8 +- .../xds/service/orca/v3/orca.upb.c | 2 +- .../xds/service/orca/v3/orca.upb.h | 8 +- .../xds/type/matcher/v3/matcher.upb.c | 12 +- .../xds/type/matcher/v3/matcher.upb.h | 72 +- .../xds/type/matcher/v3/regex.upb.c | 4 +- .../xds/type/matcher/v3/regex.upb.h | 16 +- .../xds/type/matcher/v3/string.upb.c | 2 +- .../xds/type/matcher/v3/string.upb.h | 16 +- .../xds/type/v3/typed_struct.upb.c | 2 +- .../xds/type/v3/typed_struct.upb.h | 8 +- src/core/ext/xds/upb_utils.h | 1 + .../ext/xds/xds_cluster_specifier_plugin.cc | 1 + .../ext/xds/xds_cluster_specifier_plugin.h | 1 + src/core/ext/xds/xds_http_fault_filter.h | 1 + src/core/ext/xds/xds_http_filters.h | 1 + src/core/ext/xds/xds_http_rbac_filter.h | 1 + src/core/ext/xds/xds_lb_policy_registry.cc | 3 +- src/core/lib/gprpp/status_helper.cc | 1 + src/python/grpcio/grpc_core_dependencies.py | 7 + src/upb/gen_build_yaml.py | 23 +- third_party/README.md | 2 + .../upb/.github/workflows/bazel_tests.yml | 16 +- .../upb/.github/workflows/python_tests.yml | 137 ++++ third_party/upb/BUILD | 249 +++++- third_party/upb/DESIGN.md | 4 +- third_party/upb/WORKSPACE | 8 +- third_party/upb/bazel/protobuf.patch | 119 +-- third_party/upb/bazel/py_extension.bzl | 38 - third_party/upb/bazel/python_downloads.bzl | 84 ++ .../{workspace_defs.bzl => system_python.bzl} | 20 +- third_party/upb/bazel/upb_proto_library.bzl | 1 + third_party/upb/bazel/workspace_deps.bzl | 69 +- third_party/upb/benchmarks/BUILD.googleapis | 2 +- third_party/upb/benchmarks/benchmark.cc | 25 +- third_party/upb/cmake/make_cmakelists.py | 9 + third_party/upb/docs/style-guide.md | 65 ++ third_party/upb/docs/vs-cpp-protos.md | 1 + third_party/upb/docs/wrapping-upb.in.md | 372 --------- third_party/upb/docs/wrapping-upb.md | 466 +++++++---- third_party/upb/docs/wrapping-upb/1.svg | 43 - third_party/upb/docs/wrapping-upb/2.svg | 48 -- third_party/upb/docs/wrapping-upb/3.svg | 65 -- third_party/upb/docs/wrapping-upb/4.svg | 138 ---- third_party/upb/python/BUILD | 254 +++--- third_party/upb/python/convert.c | 16 +- third_party/upb/python/convert.h | 8 +- third_party/upb/python/descriptor.c | 35 +- third_party/upb/python/descriptor.h | 2 +- third_party/upb/python/descriptor_pool.c | 17 +- third_party/upb/python/extension_dict.c | 26 +- third_party/upb/python/extension_dict.h | 2 +- third_party/upb/python/map.c | 35 +- third_party/upb/python/map.h | 2 +- third_party/upb/python/message.c | 737 ++++++++++-------- third_party/upb/python/message.h | 48 +- third_party/upb/python/minimal_test.py | 8 +- third_party/upb/python/pb_unit_tests/BUILD | 12 +- .../descriptor_database_test_wrapper.py | 4 +- .../descriptor_pool_test_wrapper.py | 16 +- .../pb_unit_tests/descriptor_test_wrapper.py | 14 +- .../pb_unit_tests/generator_test_wrapper.py | 4 +- .../pb_unit_tests/json_format_test_wrapper.py | 4 +- .../pb_unit_tests/keywords_test_wrapper.py | 4 +- .../message_factory_test_wrapper.py | 16 +- .../pb_unit_tests/message_test_wrapper.py | 31 +- .../pb_unit_tests/numpy_test_wrapper.py | 39 + .../proto_builder_test_wrapper.py | 6 +- .../pb_unit_tests}/pyproto_test_wrapper.bzl | 3 +- .../pb_unit_tests/reflection_test_wrapper.py | 16 +- .../service_reflection_test_wrapper.py | 4 +- .../symbol_database_test_wrapper.py | 4 +- .../text_encoding_test_wrapper.py | 4 +- .../pb_unit_tests/text_format_test_wrapper.py | 14 +- .../unknown_fields_test_wrapper.py | 14 +- .../well_known_types_test_wrapper.py | 5 +- .../pb_unit_tests/wire_format_test_wrapper.py | 4 +- third_party/upb/python/protobuf.c | 16 +- third_party/upb/python/protobuf.h | 10 +- third_party/upb/python/py_extension.bzl | 59 ++ third_party/upb/python/python_api.h | 61 ++ third_party/upb/python/repeated.c | 46 +- third_party/upb/python/repeated.h | 2 +- third_party/upb/python/unknown_fields.c | 407 ++++++++++ ...{api_implementation.c => unknown_fields.h} | 27 +- .../upb/third_party/utf8_range/utf8_range.h | 2 +- third_party/upb/upb/arena.c | 277 +++++++ third_party/upb/upb/arena.h | 225 ++++++ third_party/upb/upb/array.c | 114 +++ third_party/upb/upb/array.h | 83 ++ .../upb/bindings/lua/{BUILD => BUILD.bazel} | 2 +- third_party/upb/upb/bindings/lua/def.c | 59 +- .../upb/bindings/lua/lua_proto_library.bzl | 21 +- third_party/upb/upb/bindings/lua/msg.c | 18 +- third_party/upb/upb/bindings/lua/test.proto | 2 +- third_party/upb/upb/bindings/lua/test_upb.lua | 30 +- third_party/upb/upb/bindings/lua/upb.lua | 2 +- third_party/upb/upb/bindings/lua/upbc.cc | 11 +- .../{python/python.h => upb/collections.h} | 20 +- third_party/upb/upb/conformance_upb.c | 14 +- third_party/upb/upb/decode.c | 226 ++++-- third_party/upb/upb/decode.h | 1 + third_party/upb/upb/decode_fast.c | 2 +- third_party/upb/upb/decode_internal.h | 181 +---- third_party/upb/upb/def.c | 12 +- third_party/upb/upb/def.h | 9 +- third_party/upb/upb/def.hpp | 11 +- third_party/upb/upb/encode.c | 49 +- third_party/upb/upb/encode.h | 22 +- third_party/upb/upb/extension_registry.c | 93 +++ third_party/upb/upb/extension_registry.h | 84 ++ third_party/upb/upb/internal/decode.h | 211 +++++ .../upb/upb/internal/mini_table_accessors.h | 59 ++ third_party/upb/upb/internal/table.h | 385 +++++++++ third_party/upb/upb/internal/upb.h | 68 ++ .../upb/upb/internal/vsnprintf_compat.h | 52 ++ third_party/upb/upb/json_decode.c | 7 +- third_party/upb/upb/json_encode.c | 10 +- third_party/upb/upb/json_encode.h | 9 +- third_party/upb/upb/json_test.cc | 100 +++ third_party/upb/upb/json_test.proto | 20 + third_party/upb/upb/map.c | 108 +++ third_party/upb/upb/map.h | 117 +++ third_party/upb/upb/message_value.h | 66 ++ third_party/upb/upb/mini_descriptor.c | 255 ++++++ third_party/upb/upb/mini_descriptor.h | 58 ++ third_party/upb/upb/mini_table.c | 183 +++-- third_party/upb/upb/mini_table.h | 31 +- third_party/upb/upb/mini_table.hpp | 13 + third_party/upb/upb/mini_table_accessors.c | 397 ++++++++++ third_party/upb/upb/mini_table_accessors.h | 271 +++++++ .../upb/upb/mini_table_accessors_internal.h | 36 + .../upb/upb/mini_table_accessors_test.cc | 444 +++++++++++ third_party/upb/upb/mini_table_test.cc | 64 ++ third_party/upb/upb/msg.c | 64 +- third_party/upb/upb/msg.h | 47 +- third_party/upb/upb/msg_internal.h | 50 +- third_party/upb/upb/msg_test.cc | 108 ++- third_party/upb/upb/msg_test.proto | 16 +- third_party/upb/upb/port_def.inc | 3 +- third_party/upb/upb/port_undef.inc | 1 + third_party/upb/upb/reflection.c | 161 +--- third_party/upb/upb/reflection.h | 114 +-- third_party/upb/upb/status.c | 86 ++ third_party/upb/upb/status.h | 66 ++ third_party/upb/upb/table.c | 4 +- third_party/upb/upb/table_internal.h | 355 +-------- third_party/upb/upb/test.proto | 26 + third_party/upb/upb/test_cpp.cc | 16 +- third_party/upb/upb/test_generated_code.cc | 14 +- third_party/upb/upb/test_table.cc | 2 +- third_party/upb/upb/text_encode.c | 5 +- third_party/upb/upb/upb.c | 294 +------ third_party/upb/upb/upb.h | 203 +---- third_party/upb/upb/upb_internal.h | 38 +- third_party/upb/upb/util/def_to_proto.c | 17 +- third_party/upb/upb/util/def_to_proto_test.cc | 23 +- third_party/upb/upb/util/required_fields.c | 3 +- .../upb/upb/util/required_fields_test.cc | 10 +- third_party/upb/upbc/BUILD | 62 ++ third_party/upb/upbc/code_generator_request.c | 209 +++++ third_party/upb/upbc/code_generator_request.h | 52 ++ .../upb/upbc/code_generator_request.proto | 13 + third_party/upb/upbc/protoc-gen-upb.cc | 124 ++- third_party/upb/upbc/protoc-gen-upbdev.cc | 144 ++++ third_party/upb/upbc/subprocess.cc | 462 +++++++++++ third_party/upb/upbc/subprocess.h | 99 +++ tools/distrib/fix_build_deps.py | 2 + 435 files changed, 12496 insertions(+), 5316 deletions(-) create mode 100644 third_party/upb/.github/workflows/python_tests.yml delete mode 100644 third_party/upb/bazel/py_extension.bzl create mode 100644 third_party/upb/bazel/python_downloads.bzl rename third_party/upb/bazel/{workspace_defs.bzl => system_python.bzl} (79%) create mode 100644 third_party/upb/docs/style-guide.md delete mode 100644 third_party/upb/docs/wrapping-upb.in.md delete mode 100644 third_party/upb/docs/wrapping-upb/1.svg delete mode 100644 third_party/upb/docs/wrapping-upb/2.svg delete mode 100644 third_party/upb/docs/wrapping-upb/3.svg delete mode 100644 third_party/upb/docs/wrapping-upb/4.svg create mode 100644 third_party/upb/python/pb_unit_tests/numpy_test_wrapper.py rename third_party/upb/{bazel => python/pb_unit_tests}/pyproto_test_wrapper.bzl (90%) create mode 100644 third_party/upb/python/py_extension.bzl create mode 100644 third_party/upb/python/python_api.h create mode 100644 third_party/upb/python/unknown_fields.c rename third_party/upb/python/{api_implementation.c => unknown_fields.h} (77%) create mode 100644 third_party/upb/upb/arena.c create mode 100644 third_party/upb/upb/arena.h create mode 100644 third_party/upb/upb/array.c create mode 100644 third_party/upb/upb/array.h rename third_party/upb/upb/bindings/lua/{BUILD => BUILD.bazel} (98%) rename third_party/upb/{python/python.h => upb/collections.h} (73%) create mode 100644 third_party/upb/upb/extension_registry.c create mode 100644 third_party/upb/upb/extension_registry.h create mode 100644 third_party/upb/upb/internal/decode.h create mode 100644 third_party/upb/upb/internal/mini_table_accessors.h create mode 100644 third_party/upb/upb/internal/table.h create mode 100644 third_party/upb/upb/internal/upb.h create mode 100644 third_party/upb/upb/internal/vsnprintf_compat.h create mode 100644 third_party/upb/upb/json_test.cc create mode 100644 third_party/upb/upb/json_test.proto create mode 100644 third_party/upb/upb/map.c create mode 100644 third_party/upb/upb/map.h create mode 100644 third_party/upb/upb/message_value.h create mode 100644 third_party/upb/upb/mini_descriptor.c create mode 100644 third_party/upb/upb/mini_descriptor.h create mode 100644 third_party/upb/upb/mini_table_accessors.c create mode 100644 third_party/upb/upb/mini_table_accessors.h create mode 100644 third_party/upb/upb/mini_table_accessors_internal.h create mode 100644 third_party/upb/upb/mini_table_accessors_test.cc create mode 100644 third_party/upb/upb/status.c create mode 100644 third_party/upb/upb/status.h create mode 100644 third_party/upb/upbc/code_generator_request.c create mode 100644 third_party/upb/upbc/code_generator_request.h create mode 100644 third_party/upb/upbc/code_generator_request.proto create mode 100644 third_party/upb/upbc/protoc-gen-upbdev.cc create mode 100644 third_party/upb/upbc/subprocess.cc create mode 100644 third_party/upb/upbc/subprocess.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d7d7c366338..6d0412fdb99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4185,13 +4185,20 @@ 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/arena.c + third_party/upb/upb/array.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/extension_registry.c + third_party/upb/upb/json_decode.c third_party/upb/upb/json_encode.c + third_party/upb/upb/map.c + third_party/upb/upb/mini_table.c third_party/upb/upb/msg.c third_party/upb/upb/reflection.c + third_party/upb/upb/status.c third_party/upb/upb/table.c third_party/upb/upb/text_encode.c third_party/upb/upb/upb.c diff --git a/Makefile b/Makefile index bb407a58349..38739b3ae6b 100644 --- a/Makefile +++ b/Makefile @@ -2526,13 +2526,20 @@ LIBUPB_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/arena.c \ + third_party/upb/upb/array.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/extension_registry.c \ + third_party/upb/upb/json_decode.c \ third_party/upb/upb/json_encode.c \ + third_party/upb/upb/map.c \ + third_party/upb/upb/mini_table.c \ third_party/upb/upb/msg.c \ third_party/upb/upb/reflection.c \ + third_party/upb/upb/status.c \ third_party/upb/upb/table.c \ third_party/upb/upb/text_encode.c \ third_party/upb/upb/upb.c \ diff --git a/bazel/grpc_deps.bzl b/bazel/grpc_deps.bzl index c1fbb8bee5f..cde9d2d955d 100644 --- a/bazel/grpc_deps.bzl +++ b/bazel/grpc_deps.bzl @@ -349,11 +349,11 @@ def grpc_deps(): if "upb" not in native.existing_rules(): http_archive( name = "upb", - sha256 = "d0fe259d650bf9547e75896a1307bfc7034195e4ae89f5139814d295991ba681", - strip_prefix = "upb-bef53686ec702607971bd3ea4d4fefd80c6cc6e8", + sha256 = "017a7e8e4e842d01dba5dc8aa316323eee080cd1b75986a7d1f94d87220e6502", + strip_prefix = "upb-e4635f223e7d36dfbea3b722a4ca4807a7e882e2", urls = [ - "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz", - "https://github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz", + "https://storage.googleapis.com/grpc-bazel-mirror/github.com/protocolbuffers/upb/archive/e4635f223e7d36dfbea3b722a4ca4807a7e882e2.tar.gz", + "https://github.com/protocolbuffers/upb/archive/e4635f223e7d36dfbea3b722a4ca4807a7e882e2.tar.gz", ], ) diff --git a/config.m4 b/config.m4 index 47dceafd75e..86dd8438216 100644 --- a/config.m4 +++ b/config.m4 @@ -1156,13 +1156,20 @@ if test "$PHP_GRPC" != "no"; then 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/arena.c \ + third_party/upb/upb/array.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/extension_registry.c \ + third_party/upb/upb/json_decode.c \ third_party/upb/upb/json_encode.c \ + third_party/upb/upb/map.c \ + third_party/upb/upb/mini_table.c \ third_party/upb/upb/msg.c \ third_party/upb/upb/reflection.c \ + third_party/upb/upb/status.c \ third_party/upb/upb/table.c \ third_party/upb/upb/text_encode.c \ third_party/upb/upb/upb.c \ diff --git a/config.w32 b/config.w32 index 5f89baec5cd..8ac8429a028 100644 --- a/config.w32 +++ b/config.w32 @@ -1122,13 +1122,20 @@ if (PHP_GRPC != "no") { "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\\arena.c " + + "third_party\\upb\\upb\\array.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\\extension_registry.c " + + "third_party\\upb\\upb\\json_decode.c " + "third_party\\upb\\upb\\json_encode.c " + + "third_party\\upb\\upb\\map.c " + + "third_party\\upb\\upb\\mini_table.c " + "third_party\\upb\\upb\\msg.c " + "third_party\\upb\\upb\\reflection.c " + + "third_party\\upb\\upb\\status.c " + "third_party\\upb\\upb\\table.c " + "third_party\\upb\\upb\\text_encode.c " + "third_party\\upb\\upb\\upb.c " + diff --git a/gRPC-C++.podspec b/gRPC-C++.podspec index a056640f200..50c087ba549 100644 --- a/gRPC-C++.podspec +++ b/gRPC-C++.podspec @@ -1043,24 +1043,36 @@ Pod::Spec.new do |s| 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', 'third_party/upb/third_party/utf8_range/utf8_range.h', + 'third_party/upb/upb/arena.h', + 'third_party/upb/upb/array.h', + 'third_party/upb/upb/collections.h', 'third_party/upb/upb/decode.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/extension_registry.h', + 'third_party/upb/upb/internal/decode.h', + 'third_party/upb/upb/internal/table.h', + 'third_party/upb/upb/internal/upb.h', + 'third_party/upb/upb/internal/vsnprintf_compat.h', + 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/map.h', + 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mini_table.h', + 'third_party/upb/upb/mini_table.hpp', '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/reflection.hpp', + 'third_party/upb/upb/status.h', '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_internal.h', 'third_party/xxhash/xxhash.h' ss.private_header_files = 'src/core/ext/filters/channel_idle/channel_idle_filter.h', @@ -1817,24 +1829,36 @@ Pod::Spec.new do |s| 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', 'third_party/upb/third_party/utf8_range/utf8_range.h', + 'third_party/upb/upb/arena.h', + 'third_party/upb/upb/array.h', + 'third_party/upb/upb/collections.h', 'third_party/upb/upb/decode.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/extension_registry.h', + 'third_party/upb/upb/internal/decode.h', + 'third_party/upb/upb/internal/table.h', + 'third_party/upb/upb/internal/upb.h', + 'third_party/upb/upb/internal/vsnprintf_compat.h', + 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/map.h', + 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mini_table.h', + 'third_party/upb/upb/mini_table.hpp', '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/reflection.hpp', + 'third_party/upb/upb/status.h', '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_internal.h', 'third_party/xxhash/xxhash.h' end diff --git a/gRPC-Core.podspec b/gRPC-Core.podspec index 4c6e4bf60bd..c476c35d841 100644 --- a/gRPC-Core.podspec +++ b/gRPC-Core.podspec @@ -1657,18 +1657,36 @@ Pod::Spec.new do |s| '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/arena.c', + 'third_party/upb/upb/arena.h', + 'third_party/upb/upb/array.c', + 'third_party/upb/upb/array.h', + 'third_party/upb/upb/collections.h', 'third_party/upb/upb/decode.c', 'third_party/upb/upb/decode.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/extension_registry.c', + 'third_party/upb/upb/extension_registry.h', + 'third_party/upb/upb/internal/decode.h', + 'third_party/upb/upb/internal/table.h', + 'third_party/upb/upb/internal/upb.h', + 'third_party/upb/upb/internal/vsnprintf_compat.h', + 'third_party/upb/upb/json_decode.c', + 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.c', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/map.c', + 'third_party/upb/upb/map.h', + 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mini_table.c', + 'third_party/upb/upb/mini_table.h', + 'third_party/upb/upb/mini_table.hpp', 'third_party/upb/upb/msg.c', 'third_party/upb/upb/msg.h', 'third_party/upb/upb/msg_internal.h', @@ -1677,6 +1695,8 @@ Pod::Spec.new do |s| 'third_party/upb/upb/reflection.c', 'third_party/upb/upb/reflection.h', 'third_party/upb/upb/reflection.hpp', + 'third_party/upb/upb/status.c', + 'third_party/upb/upb/status.h', 'third_party/upb/upb/table.c', 'third_party/upb/upb/table_internal.h', 'third_party/upb/upb/text_encode.c', @@ -1684,7 +1704,6 @@ Pod::Spec.new do |s| 'third_party/upb/upb/upb.c', 'third_party/upb/upb/upb.h', 'third_party/upb/upb/upb.hpp', - 'third_party/upb/upb/upb_internal.h', 'third_party/xxhash/xxhash.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', @@ -2410,24 +2429,36 @@ Pod::Spec.new do |s| 'third_party/re2/util/utf.h', 'third_party/re2/util/util.h', 'third_party/upb/third_party/utf8_range/utf8_range.h', + 'third_party/upb/upb/arena.h', + 'third_party/upb/upb/array.h', + 'third_party/upb/upb/collections.h', 'third_party/upb/upb/decode.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/extension_registry.h', + 'third_party/upb/upb/internal/decode.h', + 'third_party/upb/upb/internal/table.h', + 'third_party/upb/upb/internal/upb.h', + 'third_party/upb/upb/internal/vsnprintf_compat.h', + 'third_party/upb/upb/json_decode.h', 'third_party/upb/upb/json_encode.h', + 'third_party/upb/upb/map.h', + 'third_party/upb/upb/message_value.h', + 'third_party/upb/upb/mini_table.h', + 'third_party/upb/upb/mini_table.hpp', '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/reflection.hpp', + 'third_party/upb/upb/status.h', '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_internal.h', 'third_party/xxhash/xxhash.h' end diff --git a/grpc.gemspec b/grpc.gemspec index 756d91d77b3..b2a6ed1f4aa 100644 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -2460,18 +2460,36 @@ Gem::Specification.new do |s| 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/arena.c ) + s.files += %w( third_party/upb/upb/arena.h ) + s.files += %w( third_party/upb/upb/array.c ) + s.files += %w( third_party/upb/upb/array.h ) + s.files += %w( third_party/upb/upb/collections.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_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/extension_registry.c ) + s.files += %w( third_party/upb/upb/extension_registry.h ) + s.files += %w( third_party/upb/upb/internal/decode.h ) + s.files += %w( third_party/upb/upb/internal/table.h ) + s.files += %w( third_party/upb/upb/internal/upb.h ) + s.files += %w( third_party/upb/upb/internal/vsnprintf_compat.h ) + s.files += %w( third_party/upb/upb/json_decode.c ) + s.files += %w( third_party/upb/upb/json_decode.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/map.c ) + s.files += %w( third_party/upb/upb/map.h ) + s.files += %w( third_party/upb/upb/message_value.h ) + s.files += %w( third_party/upb/upb/mini_table.c ) + s.files += %w( third_party/upb/upb/mini_table.h ) + s.files += %w( third_party/upb/upb/mini_table.hpp ) 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 ) @@ -2480,6 +2498,8 @@ Gem::Specification.new do |s| 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/status.c ) + s.files += %w( third_party/upb/upb/status.h ) s.files += %w( third_party/upb/upb/table.c ) s.files += %w( third_party/upb/upb/table_internal.h ) s.files += %w( third_party/upb/upb/text_encode.c ) @@ -2487,7 +2507,6 @@ Gem::Specification.new do |s| 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_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.gyp b/grpc.gyp index a264a716c0a..85544624d69 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -2043,13 +2043,20 @@ '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/arena.c', + 'third_party/upb/upb/array.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/extension_registry.c', + 'third_party/upb/upb/json_decode.c', 'third_party/upb/upb/json_encode.c', + 'third_party/upb/upb/map.c', + 'third_party/upb/upb/mini_table.c', 'third_party/upb/upb/msg.c', 'third_party/upb/upb/reflection.c', + 'third_party/upb/upb/status.c', 'third_party/upb/upb/table.c', 'third_party/upb/upb/text_encode.c', 'third_party/upb/upb/upb.c', diff --git a/package.xml b/package.xml index a59a5616312..c31b8b2b9cd 100644 --- a/package.xml +++ b/package.xml @@ -2378,18 +2378,36 @@ + + + + + - + + + + + + + + + + + + + + @@ -2398,6 +2416,8 @@ + + @@ -2405,7 +2425,6 @@ - diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc index d09322cac51..4689edf287e 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc @@ -26,6 +26,7 @@ #include "google/protobuf/duration.upb.h" #include "google/protobuf/timestamp.upb.h" +#include "upb/upb.h" #include #include diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h index 5dbc6afb8a1..4774bbf5d29 100644 --- a/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h +++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.h @@ -18,14 +18,13 @@ #ifndef GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H #define GRPC_CORE_EXT_FILTERS_CLIENT_CHANNEL_LB_POLICY_GRPCLB_LOAD_BALANCER_API_H - #include #include #include -#include "upb/upb.h" +#include "upb/arena.h" #include diff --git a/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c index fb910c35500..86c3c1d844a 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_admin_v3_Certificates__fields[1] = { 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_Certificate_submsgs[2] = { @@ -42,7 +42,7 @@ static const upb_MiniTable_Field envoy_admin_v3_Certificate__fields[2] = { 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, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_CertificateDetails_submsgs[4] = { @@ -65,7 +65,7 @@ static const upb_MiniTable_Field envoy_admin_v3_CertificateDetails__fields[7] = 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, + UPB_SIZE(48, 80), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_CertificateDetails_OcspDetails_submsgs[2] = { @@ -81,7 +81,7 @@ static const upb_MiniTable_Field envoy_admin_v3_CertificateDetails_OcspDetails__ 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_admin_v3_SubjectAlternateName__fields[3] = { @@ -93,7 +93,7 @@ static const upb_MiniTable_Field envoy_admin_v3_SubjectAlternateName__fields[3] 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, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[5] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h index 86ba477224f..3d93f72bb84 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/certs.upb.h @@ -65,11 +65,15 @@ UPB_INLINE envoy_admin_v3_Certificates* envoy_admin_v3_Certificates_parse_ex(con 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Certificates_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Certificates_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -119,11 +123,15 @@ UPB_INLINE envoy_admin_v3_Certificate* envoy_admin_v3_Certificate_parse_ex(const 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Certificate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Certificate_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -194,11 +202,15 @@ UPB_INLINE envoy_admin_v3_CertificateDetails* envoy_admin_v3_CertificateDetails_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -341,11 +353,15 @@ UPB_INLINE envoy_admin_v3_CertificateDetails_OcspDetails* envoy_admin_v3_Certifi 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_CertificateDetails_OcspDetails_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_CertificateDetails_OcspDetails_has_valid_from(const envoy_admin_v3_CertificateDetails_OcspDetails* msg) { return _upb_hasbit(msg, 1); @@ -418,11 +434,15 @@ UPB_INLINE envoy_admin_v3_SubjectAlternateName* envoy_admin_v3_SubjectAlternateN 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SubjectAlternateName_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_admin_v3_SubjectAlternateName_name_dns = 1, diff --git a/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c index f56ea85738c..ffb3c9537b3 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_admin_v3_Clusters__fields[1] = { 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ClusterStatus_submsgs[4] = { @@ -54,7 +54,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ClusterStatus__fields[7] = { 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, + UPB_SIZE(40, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_HostStatus_submsgs[6] = { @@ -81,7 +81,7 @@ static const upb_MiniTable_Field envoy_admin_v3_HostStatus__fields[9] = { 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, + UPB_SIZE(48, 80), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Field envoy_admin_v3_HostHealthStatus__fields[8] = { @@ -98,7 +98,7 @@ static const upb_MiniTable_Field envoy_admin_v3_HostHealthStatus__fields[8] = { 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, + UPB_SIZE(16, 16), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable *messages_layout[4] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h index 1069bc5f309..261542aede9 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/clusters.upb.h @@ -70,11 +70,15 @@ UPB_INLINE envoy_admin_v3_Clusters* envoy_admin_v3_Clusters_parse_ex(const char* 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Clusters_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Clusters_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -124,11 +128,15 @@ UPB_INLINE envoy_admin_v3_ClusterStatus* envoy_admin_v3_ClusterStatus_parse_ex(c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClusterStatus_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -271,11 +279,15 @@ UPB_INLINE envoy_admin_v3_HostStatus* envoy_admin_v3_HostStatus_parse_ex(const c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_HostStatus_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_HostStatus_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_HostStatus_has_address(const envoy_admin_v3_HostStatus* msg) { return _upb_hasbit(msg, 1); @@ -462,11 +474,15 @@ UPB_INLINE envoy_admin_v3_HostHealthStatus* envoy_admin_v3_HostHealthStatus_pars 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_HostHealthStatus_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c index c08c2f8116d..2d84a31e0f3 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ConfigDump__fields[1] = { const upb_MiniTable envoy_admin_v3_ConfigDump_msginit = { &envoy_admin_v3_ConfigDump_submsgs[0], &envoy_admin_v3_ConfigDump__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_UpdateFailureState_submsgs[2] = { @@ -46,7 +46,7 @@ static const upb_MiniTable_Field envoy_admin_v3_UpdateFailureState__fields[4] = const upb_MiniTable envoy_admin_v3_UpdateFailureState_msginit = { &envoy_admin_v3_UpdateFailureState_submsgs[0], &envoy_admin_v3_UpdateFailureState__fields[0], - UPB_SIZE(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_BootstrapConfigDump_submsgs[2] = { @@ -62,7 +62,7 @@ static const upb_MiniTable_Field envoy_admin_v3_BootstrapConfigDump__fields[2] = const upb_MiniTable envoy_admin_v3_BootstrapConfigDump_msginit = { &envoy_admin_v3_BootstrapConfigDump_submsgs[0], &envoy_admin_v3_BootstrapConfigDump__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_submsgs[2] = { @@ -79,7 +79,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump__fields[3] = const upb_MiniTable envoy_admin_v3_ListenersConfigDump_msginit = { &envoy_admin_v3_ListenersConfigDump_submsgs[0], &envoy_admin_v3_ListenersConfigDump__fields[0], - UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_StaticListener_submsgs[2] = { @@ -95,7 +95,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_StaticListen 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_DynamicListenerState_submsgs[2] = { @@ -112,7 +112,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ListenersConfigDump_DynamicListe 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ListenersConfigDump_DynamicListener_submsgs[4] = { @@ -153,7 +153,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump__fields[4] = const upb_MiniTable envoy_admin_v3_ClustersConfigDump_msginit = { &envoy_admin_v3_ClustersConfigDump_submsgs[0], &envoy_admin_v3_ClustersConfigDump__fields[0], - UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_StaticCluster_submsgs[2] = { @@ -169,7 +169,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump_StaticCluster 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ClustersConfigDump_DynamicCluster_submsgs[3] = { @@ -189,7 +189,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ClustersConfigDump_DynamicCluste 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_submsgs[2] = { @@ -205,7 +205,7 @@ static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump__fields[2] = { const upb_MiniTable envoy_admin_v3_RoutesConfigDump_msginit = { &envoy_admin_v3_RoutesConfigDump_submsgs[0], &envoy_admin_v3_RoutesConfigDump__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_submsgs[2] = { @@ -221,7 +221,7 @@ static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump_StaticRouteConf 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_submsgs[3] = { @@ -241,7 +241,7 @@ static const upb_MiniTable_Field envoy_admin_v3_RoutesConfigDump_DynamicRouteCon 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_submsgs[2] = { @@ -257,7 +257,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump__fields[2 const upb_MiniTable envoy_admin_v3_ScopedRoutesConfigDump_msginit = { &envoy_admin_v3_ScopedRoutesConfigDump_submsgs[0], &envoy_admin_v3_ScopedRoutesConfigDump__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_submsgs[2] = { @@ -274,7 +274,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump_InlineSco 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_submsgs[3] = { @@ -295,7 +295,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ScopedRoutesConfigDump_DynamicSc 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(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_submsgs[3] = { @@ -313,7 +313,7 @@ static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump__fields[3] = { const upb_MiniTable envoy_admin_v3_SecretsConfigDump_msginit = { &envoy_admin_v3_SecretsConfigDump_submsgs[0], &envoy_admin_v3_SecretsConfigDump__fields[0], - UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_DynamicSecret_submsgs[3] = { @@ -334,7 +334,7 @@ static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump_DynamicSecret_ 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(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_SecretsConfigDump_StaticSecret_submsgs[2] = { @@ -351,7 +351,7 @@ static const upb_MiniTable_Field envoy_admin_v3_SecretsConfigDump_StaticSecret__ 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_submsgs[2] = { @@ -367,7 +367,7 @@ static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump__fields[2] = const upb_MiniTable envoy_admin_v3_EndpointsConfigDump_msginit = { &envoy_admin_v3_EndpointsConfigDump_submsgs[0], &envoy_admin_v3_EndpointsConfigDump__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_submsgs[2] = { @@ -383,7 +383,7 @@ static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump_StaticEndpoi 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_submsgs[3] = { @@ -403,7 +403,7 @@ static const upb_MiniTable_Field envoy_admin_v3_EndpointsConfigDump_DynamicEndpo 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable *messages_layout[22] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h index 580f5a71251..7ba5c9d56ac 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/config_dump.upb.h @@ -128,11 +128,15 @@ UPB_INLINE envoy_admin_v3_ConfigDump* envoy_admin_v3_ConfigDump_parse_ex(const c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -182,11 +186,15 @@ UPB_INLINE envoy_admin_v3_UpdateFailureState* envoy_admin_v3_UpdateFailureState_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_UpdateFailureState_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_UpdateFailureState_has_failed_configuration(const envoy_admin_v3_UpdateFailureState* msg) { return _upb_hasbit(msg, 1); @@ -277,11 +285,15 @@ UPB_INLINE envoy_admin_v3_BootstrapConfigDump* envoy_admin_v3_BootstrapConfigDum return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_BootstrapConfigDump_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_BootstrapConfigDump_has_bootstrap(const envoy_admin_v3_BootstrapConfigDump* msg) { return _upb_hasbit(msg, 1); @@ -354,11 +366,15 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump* envoy_admin_v3_ListenersConfigDum return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -438,11 +454,15 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_StaticListener* envoy_admin_v3_Lis return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_StaticListener_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_ListenersConfigDump_StaticListener_has_listener(const envoy_admin_v3_ListenersConfigDump_StaticListener* msg) { return _upb_hasbit(msg, 1); @@ -515,11 +535,15 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListenerState* envoy_admin_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListenerState_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -601,11 +625,15 @@ UPB_INLINE envoy_admin_v3_ListenersConfigDump_DynamicListener* envoy_admin_v3_Li return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenersConfigDump_DynamicListener_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -740,11 +768,15 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump* envoy_admin_v3_ClustersConfigDump_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -845,11 +877,15 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_StaticCluster* envoy_admin_v3_Clust return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_StaticCluster_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_ClustersConfigDump_StaticCluster_has_cluster(const envoy_admin_v3_ClustersConfigDump_StaticCluster* msg) { return _upb_hasbit(msg, 1); @@ -922,11 +958,15 @@ UPB_INLINE envoy_admin_v3_ClustersConfigDump_DynamicCluster* envoy_admin_v3_Clus return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ClustersConfigDump_DynamicCluster_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1039,11 +1079,15 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump* envoy_admin_v3_RoutesConfigDump_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1114,11 +1158,15 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* envoy_admin_v3_Rou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_RoutesConfigDump_StaticRouteConfig_has_route_config(const envoy_admin_v3_RoutesConfigDump_StaticRouteConfig* msg) { return _upb_hasbit(msg, 1); @@ -1191,11 +1239,15 @@ UPB_INLINE envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig* envoy_admin_v3_Ro return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_RoutesConfigDump_DynamicRouteConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1308,11 +1360,15 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump* envoy_admin_v3_ScopedRoutesCon return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1383,11 +1439,15 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs* envoy return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_InlineScopedRouteConfigs_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1468,11 +1528,15 @@ UPB_INLINE envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs* envo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ScopedRoutesConfigDump_DynamicScopedRouteConfigs_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1593,11 +1657,15 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump* envoy_admin_v3_SecretsConfigDump_pa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1689,11 +1757,15 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_DynamicSecret* envoy_admin_v3_Secret return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_DynamicSecret_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1815,11 +1887,15 @@ UPB_INLINE envoy_admin_v3_SecretsConfigDump_StaticSecret* envoy_admin_v3_Secrets return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SecretsConfigDump_StaticSecret_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1901,11 +1977,15 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump* envoy_admin_v3_EndpointsConfigDum return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1976,11 +2056,15 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* envoy_admin_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig_has_endpoint_config(const envoy_admin_v3_EndpointsConfigDump_StaticEndpointConfig* msg) { return _upb_hasbit(msg, 1); @@ -2053,11 +2137,15 @@ UPB_INLINE envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig* envoy_admin return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_EndpointsConfigDump_DynamicEndpointConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c index e9fdb19a3eb..e00bf945ddb 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.c @@ -24,7 +24,7 @@ static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps__fields[1] = 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump__fields[2] = { @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_admin_v3_UnreadyTargetsDumps_UnreadyTarge 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h index 2c29c5fbd09..ff8d68df45a 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/init_dump.upb.h @@ -54,11 +54,15 @@ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps* envoy_admin_v3_UnreadyTargetsDump 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -108,11 +112,15 @@ UPB_INLINE envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump* envoy_admin_v3 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_UnreadyTargetsDumps_UnreadyTargetsDump_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c index 41718acc9d0..dfafc494d36 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_admin_v3_Listeners__fields[1] = { 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_admin_v3_ListenerStatus_submsgs[1] = { @@ -41,7 +41,7 @@ static const upb_MiniTable_Field envoy_admin_v3_ListenerStatus__fields[2] = { 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h index fc41db49f82..fb1e15745cf 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/listeners.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_admin_v3_Listeners* envoy_admin_v3_Listeners_parse_ex(const cha 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Listeners_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Listeners_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -110,11 +114,15 @@ UPB_INLINE envoy_admin_v3_ListenerStatus* envoy_admin_v3_ListenerStatus_parse_ex 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ListenerStatus_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c index 9b6c41f74f8..a221f2e435c 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_admin_v3_Memory__fields[6] = { 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, + UPB_SIZE(48, 48), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h index e1d6e7b985a..e76f5106ba1 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/memory.upb.h @@ -51,11 +51,15 @@ UPB_INLINE envoy_admin_v3_Memory* envoy_admin_v3_Memory_parse_ex(const char* buf 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Memory_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_Memory_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c index 023d1135cab..24330ddb714 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.c @@ -23,7 +23,7 @@ static const upb_MiniTable_Field envoy_admin_v3_SimpleMetric__fields[3] = { 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, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h index f20b5c732a7..230dd2a47eb 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/metrics.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_admin_v3_SimpleMetric* envoy_admin_v3_SimpleMetric_parse_ex(con 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_SimpleMetric_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h index abfe6e2f771..1a7d4eba4cb 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/mutex_stats.upb.h @@ -51,11 +51,15 @@ UPB_INLINE envoy_admin_v3_MutexStats* envoy_admin_v3_MutexStats_parse_ex(const c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_MutexStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_MutexStats_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h index c6ada103c1b..2b81c2099e1 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/server_info.upb.h @@ -81,11 +81,15 @@ UPB_INLINE envoy_admin_v3_ServerInfo* envoy_admin_v3_ServerInfo_parse_ex(const c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ServerInfo_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_ServerInfo_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -229,11 +233,15 @@ UPB_INLINE envoy_admin_v3_CommandLineOptions* envoy_admin_v3_CommandLineOptions_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_CommandLineOptions_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c b/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c index 4b0e8e2e7c3..fdaef640f45 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c +++ b/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field envoy_admin_v3_TapRequest__fields[2] = { 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h b/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h index 0cb7a3f25c9..93fc1b10d1c 100644 --- a/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h +++ b/src/core/ext/upb-generated/envoy/admin/v3/tap.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_admin_v3_TapRequest* envoy_admin_v3_TapRequest_parse_ex(const c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_TapRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_admin_v3_TapRequest_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/annotations/resource.upb.c b/src/core/ext/upb-generated/envoy/annotations/resource.upb.c index 9dcb83f140d..d82588748b0 100644 --- a/src/core/ext/upb-generated/envoy/annotations/resource.upb.c +++ b/src/core/ext/upb-generated/envoy/annotations/resource.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field envoy_annotations_ResourceAnnotation__fields[1] const upb_MiniTable envoy_annotations_ResourceAnnotation_msginit = { NULL, &envoy_annotations_ResourceAnnotation__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/annotations/resource.upb.h b/src/core/ext/upb-generated/envoy/annotations/resource.upb.h index 9fed463fe02..217139c1dbf 100644 --- a/src/core/ext/upb-generated/envoy/annotations/resource.upb.h +++ b/src/core/ext/upb-generated/envoy/annotations/resource.upb.h @@ -54,11 +54,15 @@ UPB_INLINE envoy_annotations_ResourceAnnotation* envoy_annotations_ResourceAnnot 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); + char* ptr; + (void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_annotations_ResourceAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -84,7 +88,7 @@ UPB_INLINE const envoy_annotations_ResourceAnnotation* envoy_annotations_resourc } 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_Message_GetOrCreateExtension(msg, &envoy_annotations_resource_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const envoy_annotations_ResourceAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c b/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c index e89226bff57..606b52d9f1b 100644 --- a/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c +++ b/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.c @@ -71,7 +71,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_AccessLogFilter__fiel 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, 24), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_ComparisonFilter_submsgs[1] = { @@ -86,7 +86,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_ComparisonFilter__fie 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_StatusCodeFilter_submsgs[1] = { @@ -100,7 +100,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_StatusCodeFilter__fie 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_DurationFilter_submsgs[1] = { @@ -114,19 +114,19 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_DurationFilter__field 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; const upb_MiniTable envoy_config_accesslog_v3_NotHealthCheckFilter_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; const upb_MiniTable envoy_config_accesslog_v3_TraceableFilter_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_RuntimeFilter_submsgs[1] = { @@ -142,7 +142,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_RuntimeFilter__fields 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_AndFilter_submsgs[1] = { @@ -156,7 +156,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_AndFilter__fields[1] 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_OrFilter_submsgs[1] = { @@ -170,7 +170,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_OrFilter__fields[1] = 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_HeaderFilter_submsgs[1] = { @@ -184,7 +184,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_HeaderFilter__fields[ 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_accesslog_v3_ResponseFlagFilter__fields[1] = { @@ -194,7 +194,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_ResponseFlagFilter__f const upb_MiniTable envoy_config_accesslog_v3_ResponseFlagFilter_msginit = { NULL, &envoy_config_accesslog_v3_ResponseFlagFilter__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_accesslog_v3_GrpcStatusFilter__fields[2] = { @@ -205,7 +205,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_GrpcStatusFilter__fie const upb_MiniTable envoy_config_accesslog_v3_GrpcStatusFilter_msginit = { NULL, &envoy_config_accesslog_v3_GrpcStatusFilter__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_MetadataFilter_submsgs[2] = { @@ -221,7 +221,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_MetadataFilter__field 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_accesslog_v3_ExtensionFilter_submsgs[1] = { @@ -236,7 +236,7 @@ static const upb_MiniTable_Field envoy_config_accesslog_v3_ExtensionFilter__fiel 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[15] = { diff --git a/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h b/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h index 1a6ac6fb6b5..64fc927959a 100644 --- a/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h +++ b/src/core/ext/upb-generated/envoy/config/accesslog/v3/accesslog.upb.h @@ -131,11 +131,15 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLog* envoy_config_accesslog_v3_Access return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLog_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_accesslog_v3_AccessLog_config_type_typed_config = 4, @@ -223,11 +227,15 @@ UPB_INLINE envoy_config_accesslog_v3_AccessLogFilter* envoy_config_accesslog_v3_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AccessLogFilter_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_accesslog_v3_AccessLogFilter_filter_specifier_status_code_filter = 1, @@ -526,11 +534,15 @@ UPB_INLINE envoy_config_accesslog_v3_ComparisonFilter* envoy_config_accesslog_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ComparisonFilter_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -590,11 +602,15 @@ UPB_INLINE envoy_config_accesslog_v3_StatusCodeFilter* envoy_config_accesslog_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_StatusCodeFilter_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_accesslog_v3_StatusCodeFilter_has_comparison(const envoy_config_accesslog_v3_StatusCodeFilter* msg) { return _upb_hasbit(msg, 1); @@ -645,11 +661,15 @@ UPB_INLINE envoy_config_accesslog_v3_DurationFilter* envoy_config_accesslog_v3_D return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_DurationFilter_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_accesslog_v3_DurationFilter_has_comparison(const envoy_config_accesslog_v3_DurationFilter* msg) { return _upb_hasbit(msg, 1); @@ -700,11 +720,15 @@ UPB_INLINE envoy_config_accesslog_v3_NotHealthCheckFilter* envoy_config_accesslo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_NotHealthCheckFilter_msginit, options, arena, &ptr, len); + return ptr; } @@ -733,11 +757,15 @@ UPB_INLINE envoy_config_accesslog_v3_TraceableFilter* envoy_config_accesslog_v3_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_TraceableFilter_msginit, options, arena, &ptr, len); + return ptr; } @@ -766,11 +794,15 @@ UPB_INLINE envoy_config_accesslog_v3_RuntimeFilter* envoy_config_accesslog_v3_Ru return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_RuntimeFilter_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -839,11 +871,15 @@ UPB_INLINE envoy_config_accesslog_v3_AndFilter* envoy_config_accesslog_v3_AndFil return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_AndFilter_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -893,11 +929,15 @@ UPB_INLINE envoy_config_accesslog_v3_OrFilter* envoy_config_accesslog_v3_OrFilte return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_OrFilter_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -947,11 +987,15 @@ UPB_INLINE envoy_config_accesslog_v3_HeaderFilter* envoy_config_accesslog_v3_Hea return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_HeaderFilter_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_accesslog_v3_HeaderFilter_has_header(const envoy_config_accesslog_v3_HeaderFilter* msg) { return _upb_hasbit(msg, 1); @@ -1002,11 +1046,15 @@ UPB_INLINE envoy_config_accesslog_v3_ResponseFlagFilter* envoy_config_accesslog_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ResponseFlagFilter_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1050,11 +1098,15 @@ UPB_INLINE envoy_config_accesslog_v3_GrpcStatusFilter* envoy_config_accesslog_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_GrpcStatusFilter_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1107,11 +1159,15 @@ UPB_INLINE envoy_config_accesslog_v3_MetadataFilter* envoy_config_accesslog_v3_M return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_MetadataFilter_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_accesslog_v3_MetadataFilter_has_matcher(const envoy_config_accesslog_v3_MetadataFilter* msg) { return _upb_hasbit(msg, 1); @@ -1184,11 +1240,15 @@ UPB_INLINE envoy_config_accesslog_v3_ExtensionFilter* envoy_config_accesslog_v3_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_accesslog_v3_ExtensionFilter_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_accesslog_v3_ExtensionFilter_config_type_typed_config = 3, diff --git a/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c b/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c index f9ef30b47c1..27f3bf72011 100644 --- a/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c +++ b/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.c @@ -99,7 +99,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap__fields[31] 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(140, 280), 31, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(144, 272), 31, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_StaticResources_submsgs[3] = { @@ -117,7 +117,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_StaticResou 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(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_DynamicResources_submsgs[3] = { @@ -137,7 +137,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Bootstrap_DynamicReso 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, 72), 5, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Bootstrap_CertificateProviderInstancesEntry_submsgs[1] = { @@ -173,7 +173,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Admin__fields[6] = { 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, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_ClusterManager_submsgs[3] = { @@ -192,7 +192,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_ClusterManager__field 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, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_submsgs[1] = { @@ -207,7 +207,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_ClusterManager_Outlie 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdogs_submsgs[2] = { @@ -223,7 +223,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdogs__fields[2] 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdog_submsgs[7] = { @@ -249,7 +249,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdog__fields[7] = 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, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(32, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Watchdog_WatchdogAction_submsgs[1] = { @@ -264,7 +264,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Watchdog_WatchdogActi 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_FatalAction_submsgs[1] = { @@ -278,7 +278,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_FatalAction__fields[1 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_Runtime_submsgs[1] = { @@ -295,7 +295,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_Runtime__fields[4] = 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, 72), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_RuntimeLayer_submsgs[4] = { @@ -316,7 +316,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer__fields[ 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, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[3] = { @@ -328,13 +328,13 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_DiskLaye const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit = { NULL, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer__fields[0], - UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; const upb_MiniTable envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_submsgs[1] = { @@ -349,7 +349,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_RuntimeLayer_RtdsLaye 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_bootstrap_v3_LayeredRuntime_submsgs[1] = { @@ -363,7 +363,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_LayeredRuntime__field 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_bootstrap_v3_CustomInlineHeader__fields[2] = { @@ -374,7 +374,7 @@ static const upb_MiniTable_Field envoy_config_bootstrap_v3_CustomInlineHeader__f 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[18] = { diff --git a/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h b/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h index 2a51a1243fc..2e9000f7a62 100644 --- a/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h +++ b/src/core/ext/upb-generated/envoy/config/bootstrap/v3/bootstrap.upb.h @@ -159,11 +159,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap* envoy_config_bootstrap_v3_Bootst return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_bootstrap_v3_Bootstrap_stats_flush_stats_flush_on_admin = 29, @@ -784,11 +788,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_StaticResources* envoy_config_boo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_StaticResources_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -880,11 +888,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Bootstrap_DynamicResources* envoy_config_bo 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Bootstrap_DynamicResources_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1017,11 +1029,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Admin* envoy_config_bootstrap_v3_Admin_pars 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Admin_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1141,11 +1157,15 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager* envoy_config_bootstrap_v3_C 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1249,11 +1269,15 @@ UPB_INLINE envoy_config_bootstrap_v3_ClusterManager_OutlierDetection* envoy_conf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_ClusterManager_OutlierDetection_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1313,11 +1337,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdogs* envoy_config_bootstrap_v3_Watchd return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdogs_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_bootstrap_v3_Watchdogs_has_main_thread_watchdog(const envoy_config_bootstrap_v3_Watchdogs* msg) { return _upb_hasbit(msg, 1); @@ -1390,11 +1418,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog* envoy_config_bootstrap_v3_Watchdo 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_has_miss_timeout(const envoy_config_bootstrap_v3_Watchdog* msg) { return _upb_hasbit(msg, 1); @@ -1576,11 +1608,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Watchdog_WatchdogAction* envoy_config_boots return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Watchdog_WatchdogAction_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_bootstrap_v3_Watchdog_WatchdogAction_has_config(const envoy_config_bootstrap_v3_Watchdog_WatchdogAction* msg) { return _upb_hasbit(msg, 1); @@ -1640,11 +1676,15 @@ UPB_INLINE envoy_config_bootstrap_v3_FatalAction* envoy_config_bootstrap_v3_Fata return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_FatalAction_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_bootstrap_v3_FatalAction_has_config(const envoy_config_bootstrap_v3_FatalAction* msg) { return _upb_hasbit(msg, 1); @@ -1695,11 +1735,15 @@ UPB_INLINE envoy_config_bootstrap_v3_Runtime* envoy_config_bootstrap_v3_Runtime_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_Runtime_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1777,11 +1821,15 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer* envoy_config_bootstrap_v3_Run return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_bootstrap_v3_RuntimeLayer_layer_specifier_static_layer = 2, @@ -1913,11 +1961,15 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer* envoy_config_bootst return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_DiskLayer_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1973,11 +2025,15 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer* envoy_config_boots return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_AdminLayer_msginit, options, arena, &ptr, len); + return ptr; } @@ -2006,11 +2062,15 @@ UPB_INLINE envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer* envoy_config_bootst return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_RuntimeLayer_RtdsLayer_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2070,11 +2130,15 @@ UPB_INLINE envoy_config_bootstrap_v3_LayeredRuntime* envoy_config_bootstrap_v3_L 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_LayeredRuntime_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -2124,11 +2188,15 @@ UPB_INLINE envoy_config_bootstrap_v3_CustomInlineHeader* envoy_config_bootstrap_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_bootstrap_v3_CustomInlineHeader_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c b/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c index 5944f119c10..26b807b7ebf 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers__fields 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_submsgs[6] = { @@ -57,7 +57,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers_Thresho 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(36, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_submsgs[2] = { @@ -73,7 +73,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_CircuitBreakers_Thresho 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h b/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h index 77452f903d8..d8bb222ebf5 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/circuit_breaker.upb.h @@ -61,11 +61,15 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers* envoy_config_cluster_v3_Circ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -136,11 +140,15 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds* envoy_config_clus 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -319,11 +327,15 @@ UPB_INLINE envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget* envoy return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_CircuitBreakers_Thresholds_RetryBudget_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c b/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c index 57b08122fb5..3a46a786fff 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.c @@ -46,7 +46,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_ClusterCollection__fiel 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_submsgs[39] = { @@ -148,7 +148,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster__fields[51] = { 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(188, 344), 51, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(192, 344), 51, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_TransportSocketMatch_submsgs[2] = { @@ -165,7 +165,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_TransportSocket 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CustomClusterType_submsgs[1] = { @@ -180,7 +180,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CustomClusterTy 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_EdsClusterConfig_submsgs[1] = { @@ -195,7 +195,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_EdsClusterConfi 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_LbSubsetConfig_submsgs[2] = { @@ -216,7 +216,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LbSubsetConfig_ 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(20, 40), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(24, 32), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector__fields[4] = { @@ -247,7 +247,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_SlowStartConfig 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, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_submsgs[1] = { @@ -261,7 +261,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RoundRobinLbCon 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_submsgs[3] = { @@ -279,7 +279,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_LeastRequestLbC 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RingHashLbConfig_submsgs[2] = { @@ -310,7 +310,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_MaglevLbConfig_ 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[1] = { @@ -320,7 +320,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_OriginalDstLbCo const upb_MiniTable envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit = { NULL, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig__fields[0], - UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_submsgs[6] = { @@ -363,13 +363,13 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig_ 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(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; const upb_MiniTable envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_submsgs[1] = { @@ -384,7 +384,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_CommonLbConfig_ 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_RefreshRate_submsgs[2] = { @@ -400,7 +400,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_RefreshRate__fi 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_PreconnectPolicy_submsgs[2] = { @@ -416,7 +416,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Cluster_PreconnectPolic 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_Cluster_TypedExtensionProtocolOptionsEntry_submsgs[1] = { @@ -445,7 +445,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_LoadBalancingPolicy__fi 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_LoadBalancingPolicy_Policy_submsgs[1] = { @@ -459,7 +459,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_LoadBalancingPolicy_Pol 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(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_UpstreamBindConfig_submsgs[1] = { @@ -473,7 +473,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_UpstreamBindConfig__fie 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_cluster_v3_UpstreamConnectionOptions_submsgs[1] = { @@ -488,7 +488,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_UpstreamConnectionOptio 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_cluster_v3_TrackClusterStats__fields[2] = { @@ -499,7 +499,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_TrackClusterStats__fiel const upb_MiniTable envoy_config_cluster_v3_TrackClusterStats_msginit = { NULL, &envoy_config_cluster_v3_TrackClusterStats__fields[0], - UPB_SIZE(2, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[25] = { diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h b/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h index 177f3292c90..22bb2b865b0 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/cluster.upb.h @@ -229,11 +229,15 @@ UPB_INLINE envoy_config_cluster_v3_ClusterCollection* envoy_config_cluster_v3_Cl 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_ClusterCollection_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_cluster_v3_ClusterCollection_has_entries(const envoy_config_cluster_v3_ClusterCollection* msg) { return _upb_hasbit(msg, 1); @@ -284,11 +288,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster* envoy_config_cluster_v3_Cluster_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_cluster_v3_Cluster_cluster_discovery_type_type = 2, @@ -1298,11 +1306,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_TransportSocketMatch* envoy_config_cl return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_TransportSocketMatch_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1384,11 +1396,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CustomClusterType* envoy_config_clust 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CustomClusterType_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1448,11 +1464,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_EdsClusterConfig* envoy_config_cluste 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_EdsClusterConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1512,11 +1532,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig* envoy_config_cluster_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -1633,11 +1657,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector* envo 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LbSubsetConfig_LbSubsetSelector_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1714,11 +1742,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_SlowStartConfig* envoy_config_cluster 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_SlowStartConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1813,11 +1845,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RoundRobinLbConfig* envoy_config_clus 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RoundRobinLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1868,11 +1904,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_LeastRequestLbConfig* envoy_config_cl 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_LeastRequestLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1967,11 +2007,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RingHashLbConfig* envoy_config_cluste return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RingHashLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2053,11 +2097,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_MaglevLbConfig* envoy_config_cluster_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_MaglevLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2108,11 +2156,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_OriginalDstLbConfig* envoy_config_clu 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_OriginalDstLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -2150,11 +2202,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig* envoy_config_cluster_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_cluster_v3_Cluster_CommonLbConfig_locality_config_specifier_zone_aware_lb_config = 2, @@ -2339,11 +2395,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig* env 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ZoneAwareLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2425,11 +2485,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_LocalityWeightedLbConfig_msginit, options, arena, &ptr, len); + return ptr; } @@ -2458,11 +2522,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbCon return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_CommonLbConfig_ConsistentHashingLbConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -2522,11 +2590,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_RefreshRate* envoy_config_cluster_v3_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_RefreshRate_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2599,11 +2671,15 @@ UPB_INLINE envoy_config_cluster_v3_Cluster_PreconnectPolicy* envoy_config_cluste 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Cluster_PreconnectPolicy_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2696,11 +2772,15 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy* envoy_config_cluster_v3_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -2750,11 +2830,15 @@ UPB_INLINE envoy_config_cluster_v3_LoadBalancingPolicy_Policy* envoy_config_clus return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_LoadBalancingPolicy_Policy_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2805,11 +2889,15 @@ UPB_INLINE envoy_config_cluster_v3_UpstreamBindConfig* envoy_config_cluster_v3_U 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamBindConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_cluster_v3_UpstreamBindConfig_has_source_address(const envoy_config_cluster_v3_UpstreamBindConfig* msg) { return _upb_hasbit(msg, 1); @@ -2860,11 +2948,15 @@ UPB_INLINE envoy_config_cluster_v3_UpstreamConnectionOptions* envoy_config_clust return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_UpstreamConnectionOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_cluster_v3_UpstreamConnectionOptions_has_tcp_keepalive(const envoy_config_cluster_v3_UpstreamConnectionOptions* msg) { return _upb_hasbit(msg, 1); @@ -2924,11 +3016,15 @@ UPB_INLINE envoy_config_cluster_v3_TrackClusterStats* envoy_config_cluster_v3_Tr return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_TrackClusterStats_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c b/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c index 44fb9e5bb94..e3571392594 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_Filter__fields[2] = { 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h b/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h index 164e46c235f..6a35d89ff87 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/filter.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_cluster_v3_Filter* envoy_config_cluster_v3_Filter_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Filter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_Filter_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c b/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c index e584f53d995..a0b6d39347d 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.c @@ -69,7 +69,7 @@ static const upb_MiniTable_Field envoy_config_cluster_v3_OutlierDetection__field 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, 184), 22, kUpb_ExtMode_NonExtendable, 22, 255, 0, + UPB_SIZE(88, 176), 22, kUpb_ExtMode_NonExtendable, 22, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h b/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h index 89d6137ec79..daab6004071 100644 --- a/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h +++ b/src/core/ext/upb-generated/envoy/config/cluster/v3/outlier_detection.upb.h @@ -55,11 +55,15 @@ UPB_INLINE envoy_config_cluster_v3_OutlierDetection* envoy_config_cluster_v3_Out return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_cluster_v3_OutlierDetection_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_cluster_v3_OutlierDetection_has_consecutive_5xx(const envoy_config_cluster_v3_OutlierDetection* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c b/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c index 86aac42f8d7..5549e125024 100644 --- a/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c +++ b/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.c @@ -49,7 +49,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_OnMatch_ 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, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_submsgs[1] = { @@ -63,7 +63,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherL 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = { @@ -83,7 +83,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherL 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, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = { @@ -115,7 +115,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherL 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = { @@ -131,7 +131,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherL 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_submsgs[4] = { @@ -165,7 +165,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_Matcher_MatcherT 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = { @@ -211,7 +211,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_MatchPredicate__ 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, + UPB_SIZE(8, 16), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_MatchPredicate_MatchSet_submsgs[1] = { @@ -225,7 +225,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_MatchPredicate_M 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_HttpHeadersMatch_submsgs[1] = { @@ -239,7 +239,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpHeadersMatch 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_common_matcher_v3_HttpGenericBodyMatch_submsgs[1] = { @@ -254,7 +254,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyM 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, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = { @@ -265,7 +265,7 @@ static const upb_MiniTable_Field envoy_config_common_matcher_v3_HttpGenericBodyM 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[15] = { diff --git a/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h b/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h index bfc0bb14b24..175d7c37b81 100644 --- a/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h +++ b/src/core/ext/upb-generated/envoy/config/common/matcher/v3/matcher.upb.h @@ -99,11 +99,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher* envoy_config_common_matcher_v 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_Matcher_matcher_type_matcher_list = 1, @@ -204,11 +208,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_OnMatch* envoy_config_common_m 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_OnMatch_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_Matcher_OnMatch_on_match_matcher = 1, @@ -287,11 +295,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList* envoy_config_comm 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -341,11 +353,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate* envoy_c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_match_type_single_predicate = 1, @@ -468,11 +484,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePr 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_value_match = 2, @@ -573,11 +593,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_Predicat 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -627,11 +651,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher* envo 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -704,11 +732,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree* envoy_config_comm 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_Matcher_MatcherTree_tree_type_exact_match_map = 2, @@ -831,11 +863,15 @@ UPB_INLINE envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap* envoy_co 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -909,11 +945,15 @@ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate* envoy_config_common_ma 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_MatchPredicate_rule_or_match = 1, @@ -1159,11 +1199,15 @@ UPB_INLINE envoy_config_common_matcher_v3_MatchPredicate_MatchSet* envoy_config_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_MatchPredicate_MatchSet_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1213,11 +1257,15 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpHeadersMatch* envoy_config_common_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpHeadersMatch_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1267,11 +1315,15 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch* envoy_config_com 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -1330,11 +1382,15 @@ UPB_INLINE envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch* 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_common_matcher_v3_HttpGenericBodyMatch_GenericTextMatch_rule_string_match = 1, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c index 112b414b27e..b2e18e14b38 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.c @@ -25,7 +25,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Pipe__fields[2] = { const upb_MiniTable envoy_config_core_v3_Pipe_msginit = { NULL, &envoy_config_core_v3_Pipe__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_EnvoyInternalAddress__fields[1] = { @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_EnvoyInternalAddress__fiel const upb_MiniTable envoy_config_core_v3_EnvoyInternalAddress_msginit = { NULL, &envoy_config_core_v3_EnvoyInternalAddress__fields[0], - UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_SocketAddress__fields[6] = { @@ -50,7 +50,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_SocketAddress__fields[6] = const upb_MiniTable envoy_config_core_v3_SocketAddress_msginit = { NULL, &envoy_config_core_v3_SocketAddress__fields[0], - UPB_SIZE(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_TcpKeepalive_submsgs[3] = { @@ -68,7 +68,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_TcpKeepalive__fields[3] = 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_BindConfig_submsgs[3] = { @@ -86,7 +86,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_BindConfig__fields[3] = { 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Address_submsgs[3] = { @@ -104,7 +104,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Address__fields[3] = { 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, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_CidrRange_submsgs[1] = { @@ -119,7 +119,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_CidrRange__fields[2] = { 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[7] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h index 6bf2093725d..83fa9a03694 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/address.upb.h @@ -80,11 +80,15 @@ UPB_INLINE envoy_config_core_v3_Pipe* envoy_config_core_v3_Pipe_parse_ex(const c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Pipe_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Pipe_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -131,11 +135,15 @@ UPB_INLINE envoy_config_core_v3_EnvoyInternalAddress* envoy_config_core_v3_Envoy return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_EnvoyInternalAddress_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_EnvoyInternalAddress_address_name_specifier_server_listener_name = 1, @@ -183,11 +191,15 @@ UPB_INLINE envoy_config_core_v3_SocketAddress* envoy_config_core_v3_SocketAddres return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SocketAddress_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_SocketAddress_port_specifier_port_value = 3, @@ -284,11 +296,15 @@ UPB_INLINE envoy_config_core_v3_TcpKeepalive* envoy_config_core_v3_TcpKeepalive_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TcpKeepalive_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_TcpKeepalive_has_keepalive_probes(const envoy_config_core_v3_TcpKeepalive* msg) { return _upb_hasbit(msg, 1); @@ -383,11 +399,15 @@ UPB_INLINE envoy_config_core_v3_BindConfig* envoy_config_core_v3_BindConfig_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_BindConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_BindConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_BindConfig_has_source_address(const envoy_config_core_v3_BindConfig* msg) { return _upb_hasbit(msg, 1); @@ -481,11 +501,15 @@ UPB_INLINE envoy_config_core_v3_Address* envoy_config_core_v3_Address_parse_ex(c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Address_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Address_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_Address_address_socket_address = 1, @@ -586,11 +610,15 @@ UPB_INLINE envoy_config_core_v3_CidrRange* envoy_config_core_v3_CidrRange_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_CidrRange_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_CidrRange_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c index 7d1256af845..577a8b07389 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_BackoffStrategy__fields[2] 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h index 9b5e6d341ec..78be6084151 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/backoff.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_core_v3_BackoffStrategy* envoy_config_core_v3_BackoffStr return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_BackoffStrategy_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_BackoffStrategy_has_base_interval(const envoy_config_core_v3_BackoffStrategy* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c index 3d71a88ddb5..95a26a00bdf 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.c @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Locality__fields[3] = { const upb_MiniTable envoy_config_core_v3_Locality_msginit = { NULL, &envoy_config_core_v3_Locality__fields[0], - UPB_SIZE(24, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_BuildVersion_submsgs[2] = { @@ -51,7 +51,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_BuildVersion__fields[2] = 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Extension_submsgs[1] = { @@ -69,7 +69,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Extension__fields[5] = { 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, 72), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Node_submsgs[6] = { @@ -129,7 +129,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Metadata__fields[2] = { 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Metadata_FilterMetadataEntry_submsgs[1] = { @@ -170,7 +170,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RuntimeUInt32__fields[2] = const upb_MiniTable envoy_config_core_v3_RuntimeUInt32_msginit = { NULL, &envoy_config_core_v3_RuntimeUInt32__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_RuntimePercent_submsgs[1] = { @@ -185,7 +185,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RuntimePercent__fields[2] 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_RuntimeDouble__fields[2] = { @@ -211,7 +211,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RuntimeFeatureFlag__fields 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_QueryParameter__fields[2] = { @@ -222,7 +222,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_QueryParameter__fields[2] 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_HeaderValue__fields[2] = { @@ -233,7 +233,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HeaderValue__fields[2] = { const upb_MiniTable envoy_config_core_v3_HeaderValue_msginit = { NULL, &envoy_config_core_v3_HeaderValue__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HeaderValueOption_submsgs[2] = { @@ -264,7 +264,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HeaderMap__fields[1] = { 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_WatchedDirectory__fields[1] = { @@ -274,7 +274,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_WatchedDirectory__fields[1 const upb_MiniTable envoy_config_core_v3_WatchedDirectory_msginit = { NULL, &envoy_config_core_v3_WatchedDirectory__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_DataSource__fields[4] = { @@ -287,7 +287,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_DataSource__fields[4] = { const upb_MiniTable envoy_config_core_v3_DataSource_msginit = { NULL, &envoy_config_core_v3_DataSource__fields[0], - UPB_SIZE(12, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_RetryPolicy_submsgs[2] = { @@ -303,7 +303,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RetryPolicy__fields[2] = { 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_RemoteDataSource_submsgs[2] = { @@ -320,7 +320,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RemoteDataSource__fields[3 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_AsyncDataSource_submsgs[2] = { @@ -336,7 +336,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_AsyncDataSource__fields[2] 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_TransportSocket_submsgs[1] = { @@ -351,7 +351,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_TransportSocket__fields[2] 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_RuntimeFractionalPercent_submsgs[1] = { @@ -366,7 +366,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RuntimeFractionalPercent__ 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_ControlPlane__fields[1] = { @@ -376,7 +376,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_ControlPlane__fields[1] = const upb_MiniTable envoy_config_core_v3_ControlPlane_msginit = { NULL, &envoy_config_core_v3_ControlPlane__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[24] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h index ee49fd14370..956de49aa03 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/base.upb.h @@ -172,11 +172,15 @@ UPB_INLINE envoy_config_core_v3_Locality* envoy_config_core_v3_Locality_parse_ex 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Locality_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Locality_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -232,11 +236,15 @@ UPB_INLINE envoy_config_core_v3_BuildVersion* envoy_config_core_v3_BuildVersion_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_BuildVersion_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_BuildVersion_has_version(const envoy_config_core_v3_BuildVersion* msg) { return _upb_hasbit(msg, 1); @@ -309,11 +317,15 @@ UPB_INLINE envoy_config_core_v3_Extension* envoy_config_core_v3_Extension_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Extension_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Extension_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -400,11 +412,15 @@ UPB_INLINE envoy_config_core_v3_Node* envoy_config_core_v3_Node_parse_ex(const c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Node_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Node_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_Node_user_agent_version_type_user_agent_version = 7, @@ -647,11 +663,15 @@ UPB_INLINE envoy_config_core_v3_Metadata* envoy_config_core_v3_Metadata_parse_ex 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Metadata_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Metadata_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -770,11 +790,15 @@ UPB_INLINE envoy_config_core_v3_RuntimeUInt32* envoy_config_core_v3_RuntimeUInt3 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeUInt32_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -821,11 +845,15 @@ UPB_INLINE envoy_config_core_v3_RuntimePercent* envoy_config_core_v3_RuntimePerc 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimePercent_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_RuntimePercent_has_default_value(const envoy_config_core_v3_RuntimePercent* msg) { return _upb_hasbit(msg, 1); @@ -885,11 +913,15 @@ UPB_INLINE envoy_config_core_v3_RuntimeDouble* envoy_config_core_v3_RuntimeDoubl return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeDouble_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -936,11 +968,15 @@ UPB_INLINE envoy_config_core_v3_RuntimeFeatureFlag* envoy_config_core_v3_Runtime return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFeatureFlag_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_RuntimeFeatureFlag_has_default_value(const envoy_config_core_v3_RuntimeFeatureFlag* msg) { return _upb_hasbit(msg, 1); @@ -1000,11 +1036,15 @@ UPB_INLINE envoy_config_core_v3_QueryParameter* envoy_config_core_v3_QueryParame return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_QueryParameter_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1051,11 +1091,15 @@ UPB_INLINE envoy_config_core_v3_HeaderValue* envoy_config_core_v3_HeaderValue_pa 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValue_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1102,11 +1146,15 @@ UPB_INLINE envoy_config_core_v3_HeaderValueOption* envoy_config_core_v3_HeaderVa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderValueOption_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_HeaderValueOption_has_header(const envoy_config_core_v3_HeaderValueOption* msg) { return _upb_hasbit(msg, 1); @@ -1188,11 +1236,15 @@ UPB_INLINE envoy_config_core_v3_HeaderMap* envoy_config_core_v3_HeaderMap_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HeaderMap_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1242,11 +1294,15 @@ UPB_INLINE envoy_config_core_v3_WatchedDirectory* envoy_config_core_v3_WatchedDi 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_WatchedDirectory_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1284,11 +1340,15 @@ UPB_INLINE envoy_config_core_v3_DataSource* envoy_config_core_v3_DataSource_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_DataSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_DataSource_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_DataSource_specifier_filename = 1, @@ -1375,11 +1435,15 @@ UPB_INLINE envoy_config_core_v3_RetryPolicy* envoy_config_core_v3_RetryPolicy_pa 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RetryPolicy_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_RetryPolicy_has_retry_back_off(const envoy_config_core_v3_RetryPolicy* msg) { return _upb_hasbit(msg, 1); @@ -1452,11 +1516,15 @@ UPB_INLINE envoy_config_core_v3_RemoteDataSource* envoy_config_core_v3_RemoteDat 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RemoteDataSource_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_RemoteDataSource_has_http_uri(const envoy_config_core_v3_RemoteDataSource* msg) { return _upb_hasbit(msg, 1); @@ -1538,11 +1606,15 @@ UPB_INLINE envoy_config_core_v3_AsyncDataSource* envoy_config_core_v3_AsyncDataS return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AsyncDataSource_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_AsyncDataSource_specifier_local = 1, @@ -1621,11 +1693,15 @@ UPB_INLINE envoy_config_core_v3_TransportSocket* envoy_config_core_v3_TransportS 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TransportSocket_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_TransportSocket_config_type_typed_config = 3, @@ -1691,11 +1767,15 @@ UPB_INLINE envoy_config_core_v3_RuntimeFractionalPercent* envoy_config_core_v3_R 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RuntimeFractionalPercent_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_RuntimeFractionalPercent_has_default_value(const envoy_config_core_v3_RuntimeFractionalPercent* msg) { return _upb_hasbit(msg, 1); @@ -1755,11 +1835,15 @@ UPB_INLINE envoy_config_core_v3_ControlPlane* envoy_config_core_v3_ControlPlane_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ControlPlane_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c index aa4bf0c866b..a8a559e8b8c 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.c @@ -46,13 +46,13 @@ static const upb_MiniTable_Field envoy_config_core_v3_ApiConfigSource__fields[9] 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, 72), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(40, 64), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; const upb_MiniTable envoy_config_core_v3_AggregatedConfigSource_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_SelfConfigSource__fields[1] = { @@ -62,7 +62,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_SelfConfigSource__fields[1 const upb_MiniTable envoy_config_core_v3_SelfConfigSource_msginit = { NULL, &envoy_config_core_v3_SelfConfigSource__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_RateLimitSettings_submsgs[2] = { @@ -78,7 +78,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_RateLimitSettings__fields[ 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_PathConfigSource_submsgs[1] = { @@ -93,7 +93,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_PathConfigSource__fields[2 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_ConfigSource_submsgs[6] = { @@ -119,7 +119,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_ConfigSource__fields[8] = 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(28, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(32, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_ExtensionConfigSource_submsgs[2] = { @@ -137,7 +137,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_ExtensionConfigSource__fie 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, + UPB_SIZE(16, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[7] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h index 0f6c5611343..25790c56a52 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/config_source.upb.h @@ -100,11 +100,15 @@ UPB_INLINE envoy_config_core_v3_ApiConfigSource* envoy_config_core_v3_ApiConfigS 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ApiConfigSource_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -283,11 +287,15 @@ UPB_INLINE envoy_config_core_v3_AggregatedConfigSource* envoy_config_core_v3_Agg return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AggregatedConfigSource_msginit, options, arena, &ptr, len); + return ptr; } @@ -316,11 +324,15 @@ UPB_INLINE envoy_config_core_v3_SelfConfigSource* envoy_config_core_v3_SelfConfi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SelfConfigSource_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -358,11 +370,15 @@ UPB_INLINE envoy_config_core_v3_RateLimitSettings* envoy_config_core_v3_RateLimi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_RateLimitSettings_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_RateLimitSettings_has_max_tokens(const envoy_config_core_v3_RateLimitSettings* msg) { return _upb_hasbit(msg, 1); @@ -435,11 +451,15 @@ UPB_INLINE envoy_config_core_v3_PathConfigSource* envoy_config_core_v3_PathConfi 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_PathConfigSource_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -499,11 +519,15 @@ UPB_INLINE envoy_config_core_v3_ConfigSource* envoy_config_core_v3_ConfigSource_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ConfigSource_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_ConfigSource_config_source_specifier_path = 1, @@ -691,11 +715,15 @@ UPB_INLINE envoy_config_core_v3_ExtensionConfigSource* envoy_config_core_v3_Exte 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ExtensionConfigSource_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_ExtensionConfigSource_has_config_source(const envoy_config_core_v3_ExtensionConfigSource* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c index 65b15a5546f..c2709636ce5 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_EventServiceConfig__fields 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h index bfc600e59f9..93b84f9e3a8 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/event_service_config.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_core_v3_EventServiceConfig* envoy_config_core_v3_EventSe return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_EventServiceConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_EventServiceConfig_config_source_specifier_grpc_service = 1, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c index 1c1215ab5ff..9aa57e0a0c0 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_TypedExtensionConfig__fiel 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h index 1628682b23f..dd48f15cb70 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/extension.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_core_v3_TypedExtensionConfig* envoy_config_core_v3_Typed return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TypedExtensionConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c index d33bc5a87d4..c4267c31f5a 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList__fields[1] 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList_Service__fields[2] = { @@ -37,7 +37,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcMethodList_Service__fi 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h index 17e91323848..b500d2893be 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_method_list.upb.h @@ -54,11 +54,15 @@ UPB_INLINE envoy_config_core_v3_GrpcMethodList* envoy_config_core_v3_GrpcMethodL 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -108,11 +112,15 @@ UPB_INLINE envoy_config_core_v3_GrpcMethodList_Service* envoy_config_core_v3_Grp 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcMethodList_Service_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c index 6cc07ab4e3c..49f188632fe 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.c @@ -39,7 +39,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService__fields[4] = { 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[2] = { @@ -50,7 +50,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_EnvoyGrpc__fie const upb_MiniTable envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit = { NULL, &envoy_config_core_v3_GrpcService_EnvoyGrpc__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_submsgs[5] = { @@ -75,7 +75,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc__fi 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, 104), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(48, 96), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_submsgs[3] = { @@ -93,13 +93,13 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Ssl 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; const upb_MiniTable envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_submsgs[3] = { @@ -117,7 +117,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cha 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, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_submsgs[5] = { @@ -141,7 +141,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cal 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(12, 24), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(16, 24), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials__fields[2] = { @@ -163,7 +163,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cal 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_submsgs[1] = { @@ -178,7 +178,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cal 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService__fields[9] = { @@ -196,7 +196,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cal 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, 152), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(72, 144), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_submsgs[1] = { @@ -210,7 +210,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cha 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value__fields[2] = { @@ -221,7 +221,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcService_GoogleGrpc_Cha 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_ArgsEntry_submsgs[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h index e0e2136cdf7..fda73883a43 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/grpc_service.upb.h @@ -104,11 +104,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService* envoy_config_core_v3_GrpcService_pa 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_GrpcService_target_specifier_envoy_grpc = 1, @@ -230,11 +234,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_EnvoyGrpc* envoy_config_core_v3_Grpc return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_EnvoyGrpc_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -281,11 +289,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc* envoy_config_core_v3_Grp 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -450,11 +462,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials* envoy_con 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_SslCredentials_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -549,11 +565,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials* e return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_GoogleLocalCredentials_msginit, options, arena, &ptr, len); + return ptr; } @@ -582,11 +602,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials* envoy 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelCredentials_credential_specifier_ssl_credentials = 1, @@ -687,11 +711,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials* envoy_co 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_credential_specifier_access_token = 1, @@ -862,11 +890,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAc return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_ServiceAccountJWTAccessCredentials_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -913,11 +945,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAM return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_GoogleIAMCredentials_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -964,11 +1000,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataC 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_MetadataCredentialsFromPlugin_config_type_typed_config = 3, @@ -1034,11 +1074,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsServic 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_CallCredentials_StsService_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1148,11 +1192,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs* envoy_config return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1206,11 +1254,15 @@ UPB_INLINE envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value* envoy_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_GrpcService_GoogleGrpc_ChannelArgs_Value_value_specifier_string_value = 1, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c index 16fdade688a..34f798af6bc 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthStatusSet__fields[1] 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_submsgs[20] = { @@ -86,7 +86,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck__fields[23] = 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(92, 168), 23, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(96, 168), 23, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_Payload__fields[2] = { @@ -97,7 +97,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_Payload__field const upb_MiniTable envoy_config_core_v3_HealthCheck_Payload_msginit = { NULL, &envoy_config_core_v3_HealthCheck_Payload__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_HttpHealthCheck_submsgs[6] = { @@ -125,7 +125,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_HttpHealthChec 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(52, 104), 10, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(56, 96), 10, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_TcpHealthCheck_submsgs[2] = { @@ -141,7 +141,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TcpHealthCheck 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[1] = { @@ -151,7 +151,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_RedisHealthChe const upb_MiniTable envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit = { NULL, &envoy_config_core_v3_HealthCheck_RedisHealthCheck__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_GrpcHealthCheck_submsgs[1] = { @@ -167,7 +167,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_GrpcHealthChec 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HealthCheck_CustomHealthCheck_submsgs[1] = { @@ -182,7 +182,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_CustomHealthCh 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TlsOptions__fields[1] = { @@ -192,7 +192,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HealthCheck_TlsOptions__fi const upb_MiniTable envoy_config_core_v3_HealthCheck_TlsOptions_msginit = { NULL, &envoy_config_core_v3_HealthCheck_TlsOptions__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[9] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h index 8b1aa744357..bd264a141de 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/health_check.upb.h @@ -102,11 +102,15 @@ UPB_INLINE envoy_config_core_v3_HealthStatusSet* envoy_config_core_v3_HealthStat 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthStatusSet_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -150,11 +154,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck* envoy_config_core_v3_HealthCheck_pa 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_HealthCheck_health_checker_http_health_check = 8, @@ -656,11 +664,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_Payload* envoy_config_core_v3_Health return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_Payload_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_HealthCheck_Payload_payload_text = 1, @@ -721,11 +733,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_HttpHealthCheck* envoy_config_core_v 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_HttpHealthCheck_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -925,11 +941,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TcpHealthCheck* envoy_config_core_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TcpHealthCheck_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_HealthCheck_TcpHealthCheck_has_send(const envoy_config_core_v3_HealthCheck_TcpHealthCheck* msg) { return _upb_hasbit(msg, 1); @@ -1001,11 +1021,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_RedisHealthCheck* envoy_config_core_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_RedisHealthCheck_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1043,11 +1067,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_GrpcHealthCheck* envoy_config_core_v return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_GrpcHealthCheck_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1115,11 +1143,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_CustomHealthCheck* envoy_config_core return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_CustomHealthCheck_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_HealthCheck_CustomHealthCheck_config_type_typed_config = 3, @@ -1185,11 +1217,15 @@ UPB_INLINE envoy_config_core_v3_HealthCheck_TlsOptions* envoy_config_core_v3_Hea return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HealthCheck_TlsOptions_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c index 966f3607dbf..a94db60061a 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HttpUri__fields[3] = { 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(28, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(32, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h index ca883b509c2..6443f43e663 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/http_uri.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_core_v3_HttpUri* envoy_config_core_v3_HttpUri_parse_ex(c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HttpUri_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HttpUri_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_HttpUri_http_upstream_type_cluster = 2, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c index 92da08056ed..fa32caf96f0 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.c @@ -24,7 +24,7 @@ const upb_MiniTable envoy_config_core_v3_TcpProtocolOptions_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_QuicKeepAliveSettings_submsgs[2] = { @@ -40,7 +40,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_QuicKeepAliveSettings__fie 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_QuicProtocolOptions_submsgs[5] = { @@ -62,7 +62,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_QuicProtocolOptions__field 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, + UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[3] = { @@ -74,7 +74,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_UpstreamHttpProtocolOption const upb_MiniTable envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit = { NULL, &envoy_config_core_v3_UpstreamHttpProtocolOptions__fields[0], - UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_AlternateProtocolsCacheOptions_submsgs[3] = { @@ -93,7 +93,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOpt 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, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry__fields[2] = { @@ -104,7 +104,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_AlternateProtocolsCacheOpt 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_HttpProtocolOptions_submsgs[5] = { @@ -127,7 +127,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_HttpProtocolOptions__field 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(28, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 48), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Http1ProtocolOptions_submsgs[3] = { @@ -149,7 +149,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Http1ProtocolOptions__fiel 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, 56), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(24, 48), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_submsgs[2] = { @@ -165,13 +165,13 @@ static const upb_MiniTable_Field envoy_config_core_v3_Http1ProtocolOptions_Heade 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, 24), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; const upb_MiniTable envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_KeepaliveSettings_submsgs[4] = { @@ -191,7 +191,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_KeepaliveSettings__fields[ 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Http2ProtocolOptions_submsgs[12] = { @@ -246,7 +246,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Http2ProtocolOptions_Setti 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_GrpcProtocolOptions_submsgs[1] = { @@ -260,7 +260,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_GrpcProtocolOptions__field 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_Http3ProtocolOptions_submsgs[2] = { @@ -277,7 +277,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_Http3ProtocolOptions__fiel 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, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_core_v3_SchemeHeaderTransformation__fields[1] = { @@ -287,7 +287,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_SchemeHeaderTransformation 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, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[16] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h index 09e6ebd7e2e..1b6bca3c72a 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/protocol.upb.h @@ -112,11 +112,15 @@ UPB_INLINE envoy_config_core_v3_TcpProtocolOptions* envoy_config_core_v3_TcpProt 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_TcpProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } @@ -145,11 +149,15 @@ UPB_INLINE envoy_config_core_v3_QuicKeepAliveSettings* envoy_config_core_v3_Quic return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_QuicKeepAliveSettings_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_QuicKeepAliveSettings_has_max_interval(const envoy_config_core_v3_QuicKeepAliveSettings* msg) { return _upb_hasbit(msg, 1); @@ -222,11 +230,15 @@ UPB_INLINE envoy_config_core_v3_QuicProtocolOptions* envoy_config_core_v3_QuicPr 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_QuicProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_QuicProtocolOptions_has_max_concurrent_streams(const envoy_config_core_v3_QuicProtocolOptions* msg) { return _upb_hasbit(msg, 1); @@ -365,11 +377,15 @@ UPB_INLINE envoy_config_core_v3_UpstreamHttpProtocolOptions* envoy_config_core_v 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_UpstreamHttpProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -425,11 +441,15 @@ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions* envoy_config_cor 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -532,11 +552,15 @@ UPB_INLINE envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocol 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_AlternateProtocolsCacheOptions_AlternateProtocolsCacheEntry_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -583,11 +607,15 @@ UPB_INLINE envoy_config_core_v3_HttpProtocolOptions* envoy_config_core_v3_HttpPr 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_HttpProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_HttpProtocolOptions_has_idle_timeout(const envoy_config_core_v3_HttpProtocolOptions* msg) { return _upb_hasbit(msg, 1); @@ -735,11 +763,15 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions* envoy_config_core_v3_Http1 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_Http1ProtocolOptions_has_allow_absolute_url(const envoy_config_core_v3_Http1ProtocolOptions* msg) { return _upb_hasbit(msg, 1); @@ -870,11 +902,15 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat* envoy_conf return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_header_format_proper_case_words = 1, @@ -953,11 +989,15 @@ UPB_INLINE envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseW return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http1ProtocolOptions_HeaderKeyFormat_ProperCaseWords_msginit, options, arena, &ptr, len); + return ptr; } @@ -986,11 +1026,15 @@ UPB_INLINE envoy_config_core_v3_KeepaliveSettings* envoy_config_core_v3_Keepaliv return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_KeepaliveSettings_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_KeepaliveSettings_has_interval(const envoy_config_core_v3_KeepaliveSettings* msg) { return _upb_hasbit(msg, 1); @@ -1107,11 +1151,15 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions* envoy_config_core_v3_Http2 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_has_hpack_table_size(const envoy_config_core_v3_Http2ProtocolOptions* msg) { return _upb_hasbit(msg, 1); @@ -1430,11 +1478,15 @@ UPB_INLINE envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* envoy_co return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter_has_identifier(const envoy_config_core_v3_Http2ProtocolOptions_SettingsParameter* msg) { return _upb_hasbit(msg, 1); @@ -1507,11 +1559,15 @@ UPB_INLINE envoy_config_core_v3_GrpcProtocolOptions* envoy_config_core_v3_GrpcPr return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_GrpcProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_GrpcProtocolOptions_has_http2_protocol_options(const envoy_config_core_v3_GrpcProtocolOptions* msg) { return _upb_hasbit(msg, 1); @@ -1562,11 +1618,15 @@ UPB_INLINE envoy_config_core_v3_Http3ProtocolOptions* envoy_config_core_v3_Http3 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_Http3ProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_core_v3_Http3ProtocolOptions_has_quic_protocol_options(const envoy_config_core_v3_Http3ProtocolOptions* msg) { return _upb_hasbit(msg, 1); @@ -1648,11 +1708,15 @@ UPB_INLINE envoy_config_core_v3_SchemeHeaderTransformation* envoy_config_core_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SchemeHeaderTransformation_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_SchemeHeaderTransformation_transformation_scheme_to_overwrite = 1, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c index 38eddac6175..00b25f1a837 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_ProxyProtocolConfig__field const upb_MiniTable envoy_config_core_v3_ProxyProtocolConfig_msginit = { NULL, &envoy_config_core_v3_ProxyProtocolConfig__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h index f76bb45be9c..78a724a274f 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/proxy_protocol.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_config_core_v3_ProxyProtocolConfig* envoy_config_core_v3_ProxyP 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_ProxyProtocolConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c index 06be57246f5..4badbdae516 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.c @@ -23,7 +23,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_DnsResolverOptions__fields 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, + UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_core_v3_DnsResolutionConfig_submsgs[2] = { @@ -39,7 +39,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_DnsResolutionConfig__field 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h index 4b486d3c2f2..be2da48bc1f 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/resolver.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_config_core_v3_DnsResolverOptions* envoy_config_core_v3_DnsReso 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolverOptions_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -107,11 +111,15 @@ UPB_INLINE envoy_config_core_v3_DnsResolutionConfig* envoy_config_core_v3_DnsRes 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_DnsResolutionConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h index 2bfceeb4756..0783d4320b2 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/socket_option.upb.h @@ -57,11 +57,15 @@ UPB_INLINE envoy_config_core_v3_SocketOption* envoy_config_core_v3_SocketOption_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SocketOption_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SocketOption_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_SocketOption_value_int_value = 4, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c index 2c9504a5413..43fcbb2ca86 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.c @@ -36,7 +36,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_SubstitutionFormatString__ 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(28, 56), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 48), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h index 1b16e8feb56..1a113f70031 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/substitution_format_string.upb.h @@ -57,11 +57,15 @@ UPB_INLINE envoy_config_core_v3_SubstitutionFormatString* envoy_config_core_v3_S return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_SubstitutionFormatString_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_core_v3_SubstitutionFormatString_format_text_format = 1, diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c b/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c index 440948b6c37..9af56d37e15 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c +++ b/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field envoy_config_core_v3_UdpSocketConfig__fields[2] 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h b/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h index 66b2b60274f..d161b4f9f25 100644 --- a/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h +++ b/src/core/ext/upb-generated/envoy/config/core/v3/udp_socket_config.upb.h @@ -55,11 +55,15 @@ UPB_INLINE envoy_config_core_v3_UdpSocketConfig* envoy_config_core_v3_UdpSocketC 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_core_v3_UdpSocketConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c index b57f5fc788f..edf8a519572 100644 --- a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c +++ b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.c @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_ 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, 56), 4, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_submsgs[3] = { @@ -53,7 +53,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_ 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, 40), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_submsgs[1] = { @@ -68,7 +68,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_ClusterLoadAssignment_ 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterLoadAssignment_NamedEndpointsEntry_submsgs[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h index cc81a556b5e..2fecd56c75c 100644 --- a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h +++ b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint.upb.h @@ -70,11 +70,15 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment* envoy_config_endpoint 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -180,11 +184,15 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy* envoy_config_e 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -278,11 +286,15 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload* e return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterLoadAssignment_Policy_DropOverload_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c index baaf31e8674..7f55334ea86 100644 --- a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c +++ b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.c @@ -34,7 +34,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint__fields[3] = 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[2] = { @@ -45,7 +45,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_Endpoint_HealthCheckCo const upb_MiniTable envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit = { NULL, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_LbEndpoint_submsgs[3] = { @@ -65,7 +65,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_LbEndpoint__fields[5] 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_LedsClusterLocalityConfig_submsgs[1] = { @@ -80,7 +80,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_LedsClusterLocalityCon 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_LocalityLbEndpoints_submsgs[6] = { @@ -119,7 +119,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_LocalityLbEndpoints_Lb 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[6] = { diff --git a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h index b612223077e..e5a275f10bb 100644 --- a/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h +++ b/src/core/ext/upb-generated/envoy/config/endpoint/v3/endpoint_components.upb.h @@ -76,11 +76,15 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint* envoy_config_endpoint_v3_Endpoint_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_endpoint_v3_Endpoint_has_address(const envoy_config_endpoint_v3_Endpoint* msg) { return _upb_hasbit(msg, 1); @@ -162,11 +166,15 @@ UPB_INLINE envoy_config_endpoint_v3_Endpoint_HealthCheckConfig* envoy_config_end return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_Endpoint_HealthCheckConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -213,11 +221,15 @@ UPB_INLINE envoy_config_endpoint_v3_LbEndpoint* envoy_config_endpoint_v3_LbEndpo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LbEndpoint_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_endpoint_v3_LbEndpoint_host_identifier_endpoint = 1, @@ -340,11 +352,15 @@ UPB_INLINE envoy_config_endpoint_v3_LedsClusterLocalityConfig* envoy_config_endp 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LedsClusterLocalityConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_endpoint_v3_LedsClusterLocalityConfig_has_leds_config(const envoy_config_endpoint_v3_LedsClusterLocalityConfig* msg) { return _upb_hasbit(msg, 1); @@ -404,11 +420,15 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints* envoy_config_endpoint_v 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_endpoint_v3_LocalityLbEndpoints_lb_config_load_balancer_endpoints = 7, @@ -583,11 +603,15 @@ UPB_INLINE envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList* envoy_co 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_LocalityLbEndpoints_LbEndpointList_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c b/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c index 927b2bf38db..d1981786757 100644 --- a/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c +++ b/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.c @@ -39,7 +39,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_UpstreamLocalityStats_ 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, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_UpstreamEndpointStats_submsgs[3] = { @@ -61,7 +61,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_UpstreamEndpointStats_ 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(48, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(48, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Field envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[3] = { @@ -73,7 +73,7 @@ static const upb_MiniTable_Field envoy_config_endpoint_v3_EndpointLoadMetricStat const upb_MiniTable envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit = { NULL, &envoy_config_endpoint_v3_EndpointLoadMetricStats__fields[0], - UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_endpoint_v3_ClusterStats_submsgs[3] = { diff --git a/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h b/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h index 2ba305aacfd..ff40dee8fb6 100644 --- a/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h +++ b/src/core/ext/upb-generated/envoy/config/endpoint/v3/load_report.upb.h @@ -71,11 +71,15 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamLocalityStats* envoy_config_endpoint return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamLocalityStats_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_endpoint_v3_UpstreamLocalityStats_has_locality(const envoy_config_endpoint_v3_UpstreamLocalityStats* msg) { return _upb_hasbit(msg, 1); @@ -213,11 +217,15 @@ UPB_INLINE envoy_config_endpoint_v3_UpstreamEndpointStats* envoy_config_endpoint return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_UpstreamEndpointStats_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_endpoint_v3_UpstreamEndpointStats_has_address(const envoy_config_endpoint_v3_UpstreamEndpointStats* msg) { return _upb_hasbit(msg, 1); @@ -347,11 +355,15 @@ UPB_INLINE envoy_config_endpoint_v3_EndpointLoadMetricStats* envoy_config_endpoi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_EndpointLoadMetricStats_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -407,11 +419,15 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats* envoy_config_endpoint_v3_Clust return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -531,11 +547,15 @@ UPB_INLINE envoy_config_endpoint_v3_ClusterStats_DroppedRequests* envoy_config_e return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_endpoint_v3_ClusterStats_DroppedRequests_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c b/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c index c031cac22b6..f5560641b70 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_ApiListener__fields[1] 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h b/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h index 4f47814f7f3..d5d726191f5 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/api_listener.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_listener_v3_ApiListener* envoy_config_listener_v3_ApiLis 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ApiListener_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_listener_v3_ApiListener_has_api_listener(const envoy_config_listener_v3_ApiListener* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c b/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c index 2c075ecc3e6..5aebd96e98c 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.c @@ -38,7 +38,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_ListenerCollection__fi 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_submsgs[21] = { @@ -100,7 +100,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_Listener__fields[29] = 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(124, 232), 29, kUpb_ExtMode_NonExtendable, 13, 255, 0, + UPB_SIZE(128, 224), 29, kUpb_ExtMode_NonExtendable, 13, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_DeprecatedV1_submsgs[1] = { @@ -114,7 +114,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_Listener_DeprecatedV1_ 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_Listener_ConnectionBalanceConfig_submsgs[1] = { @@ -128,19 +128,19 @@ static const upb_MiniTable_Field envoy_config_listener_v3_Listener_ConnectionBal 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 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, + UPB_SIZE(0, 0), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[6] = { diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h b/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h index 34708518b6f..ea82704ef70 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/listener.upb.h @@ -95,11 +95,15 @@ UPB_INLINE envoy_config_listener_v3_ListenerCollection* envoy_config_listener_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerCollection_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -149,11 +153,15 @@ UPB_INLINE envoy_config_listener_v3_Listener* envoy_config_listener_v3_Listener_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_listener_v3_Listener_listener_specifier_internal_listener = 27, @@ -718,11 +726,15 @@ UPB_INLINE envoy_config_listener_v3_Listener_DeprecatedV1* envoy_config_listener return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_DeprecatedV1_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -773,11 +785,15 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig* envoy_conf return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_listener_v3_Listener_ConnectionBalanceConfig_balance_type_exact_balance = 1, @@ -834,11 +850,15 @@ UPB_INLINE envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalanc 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_ConnectionBalanceConfig_ExactBalance_msginit, options, arena, &ptr, len); + return ptr; } @@ -867,11 +887,15 @@ UPB_INLINE envoy_config_listener_v3_Listener_InternalListenerConfig* envoy_confi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Listener_InternalListenerConfig_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c b/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c index e83a340a7e0..b5b035b8df4 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.c @@ -37,7 +37,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_Filter__fields[3] = { 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, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChainMatch_submsgs[5] = { @@ -92,7 +92,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_FilterChain__fields[8] 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, 88), 8, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(40, 80), 8, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_FilterChain_OnDemandConfiguration_submsgs[1] = { @@ -106,7 +106,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_FilterChain_OnDemandCo 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_submsgs[4] = { @@ -127,7 +127,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilterChainMat 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, 24), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(8, 16), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_submsgs[1] = { @@ -141,7 +141,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_ListenerFilterChainMat 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_listener_v3_ListenerFilter_submsgs[3] = { diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h b/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h index 7b7e3b7886c..3052fb84ee8 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/listener_components.upb.h @@ -93,11 +93,15 @@ UPB_INLINE envoy_config_listener_v3_Filter* envoy_config_listener_v3_Filter_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Filter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_Filter_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_listener_v3_Filter_config_type_typed_config = 4, @@ -185,11 +189,15 @@ UPB_INLINE envoy_config_listener_v3_FilterChainMatch* envoy_config_listener_v3_F 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChainMatch_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -397,11 +405,15 @@ UPB_INLINE envoy_config_listener_v3_FilterChain* envoy_config_listener_v3_Filter 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_listener_v3_FilterChain_has_filter_chain_match(const envoy_config_listener_v3_FilterChain* msg) { return _upb_hasbit(msg, 1); @@ -592,11 +604,15 @@ UPB_INLINE envoy_config_listener_v3_FilterChain_OnDemandConfiguration* envoy_con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_FilterChain_OnDemandConfiguration_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -647,11 +663,15 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate* envoy_con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_listener_v3_ListenerFilterChainMatchPredicate_rule_or_match = 1, @@ -787,11 +807,15 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet* return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilterChainMatchPredicate_MatchSet_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -841,11 +865,15 @@ UPB_INLINE envoy_config_listener_v3_ListenerFilter* envoy_config_listener_v3_Lis return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ListenerFilter_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_listener_v3_ListenerFilter_config_type_typed_config = 3, diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c b/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c index be4fb5fd75c..5245adcb3cb 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.c @@ -43,7 +43,7 @@ static const upb_MiniTable_Field envoy_config_listener_v3_QuicProtocolOptions__f 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, + UPB_SIZE(32, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h b/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h index ddaa535ff69..203c628c07b 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/quic_config.upb.h @@ -61,11 +61,15 @@ UPB_INLINE envoy_config_listener_v3_QuicProtocolOptions* envoy_config_listener_v 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_QuicProtocolOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_listener_v3_QuicProtocolOptions_has_quic_protocol_options(const envoy_config_listener_v3_QuicProtocolOptions* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c b/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c index 403aa19451a..95b06463808 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.c @@ -29,13 +29,13 @@ static const upb_MiniTable_Field envoy_config_listener_v3_UdpListenerConfig__fie 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; const upb_MiniTable envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h b/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h index b765c97fba4..729818d68aa 100644 --- a/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h +++ b/src/core/ext/upb-generated/envoy/config/listener/v3/udp_listener_config.upb.h @@ -58,11 +58,15 @@ UPB_INLINE envoy_config_listener_v3_UdpListenerConfig* envoy_config_listener_v3_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_UdpListenerConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_listener_v3_UdpListenerConfig_has_downstream_socket_config(const envoy_config_listener_v3_UdpListenerConfig* msg) { return _upb_hasbit(msg, 1); @@ -135,11 +139,15 @@ UPB_INLINE envoy_config_listener_v3_ActiveRawUdpListenerConfig* envoy_config_lis return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_listener_v3_ActiveRawUdpListenerConfig_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c b/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c index 482880a2955..fa40c5b29f2 100644 --- a/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c +++ b/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.c @@ -33,7 +33,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_MetricsServiceConfig__f 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, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h b/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h index 051c7126dfa..c268f26dc08 100644 --- a/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h +++ b/src/core/ext/upb-generated/envoy/config/metrics/v3/metrics_service.upb.h @@ -55,11 +55,15 @@ UPB_INLINE envoy_config_metrics_v3_MetricsServiceConfig* envoy_config_metrics_v3 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_MetricsServiceConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_metrics_v3_MetricsServiceConfig_has_grpc_service(const envoy_config_metrics_v3_MetricsServiceConfig* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c b/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c index 6d84620537a..a6cff06fc4e 100644 --- a/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c +++ b/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_StatsSink__fields[2] = 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsConfig_submsgs[4] = { @@ -51,7 +51,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_StatsConfig__fields[4] 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsMatcher_submsgs[2] = { @@ -68,7 +68,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_StatsMatcher__fields[3] 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, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field envoy_config_metrics_v3_TagSpecifier__fields[3] = { @@ -80,7 +80,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_TagSpecifier__fields[3] const upb_MiniTable envoy_config_metrics_v3_TagSpecifier_msginit = { NULL, &envoy_config_metrics_v3_TagSpecifier__fields[0], - UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_metrics_v3_HistogramBucketSettings_submsgs[1] = { @@ -95,7 +95,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_HistogramBucketSettings 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_metrics_v3_StatsdSink_submsgs[1] = { @@ -111,7 +111,7 @@ static const upb_MiniTable_Field envoy_config_metrics_v3_StatsdSink__fields[3] = 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_metrics_v3_DogStatsdSink_submsgs[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h b/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h index 7928e49363e..5bba950f025 100644 --- a/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h +++ b/src/core/ext/upb-generated/envoy/config/metrics/v3/stats.upb.h @@ -84,11 +84,15 @@ UPB_INLINE envoy_config_metrics_v3_StatsSink* envoy_config_metrics_v3_StatsSink_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsSink_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_metrics_v3_StatsSink_config_type_typed_config = 3, @@ -154,11 +158,15 @@ UPB_INLINE envoy_config_metrics_v3_StatsConfig* envoy_config_metrics_v3_StatsCon return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -273,11 +281,15 @@ UPB_INLINE envoy_config_metrics_v3_StatsMatcher* envoy_config_metrics_v3_StatsMa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_metrics_v3_StatsMatcher_stats_matcher_reject_all = 1, @@ -369,11 +381,15 @@ UPB_INLINE envoy_config_metrics_v3_TagSpecifier* envoy_config_metrics_v3_TagSpec return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_TagSpecifier_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_metrics_v3_TagSpecifier_tag_value_regex = 2, @@ -443,11 +459,15 @@ UPB_INLINE envoy_config_metrics_v3_HistogramBucketSettings* envoy_config_metrics return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_HistogramBucketSettings_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_metrics_v3_HistogramBucketSettings_has_match(const envoy_config_metrics_v3_HistogramBucketSettings* msg) { return _upb_hasbit(msg, 1); @@ -513,11 +533,15 @@ UPB_INLINE envoy_config_metrics_v3_StatsdSink* envoy_config_metrics_v3_StatsdSin return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_StatsdSink_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_metrics_v3_StatsdSink_statsd_specifier_address = 1, @@ -596,11 +620,15 @@ UPB_INLINE envoy_config_metrics_v3_DogStatsdSink* envoy_config_metrics_v3_DogSta return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_DogStatsdSink_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_metrics_v3_DogStatsdSink_dog_statsd_specifier_address = 1, @@ -688,11 +716,15 @@ UPB_INLINE envoy_config_metrics_v3_HystrixSink* envoy_config_metrics_v3_HystrixS return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_metrics_v3_HystrixSink_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c b/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c index 0583c32c008..2344d86cec2 100644 --- a/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c +++ b/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.c @@ -30,7 +30,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_ResourceMonitor__field 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_overload_v3_ThresholdTrigger__fields[1] = { @@ -51,7 +51,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_ScaledTrigger__fields[ const upb_MiniTable envoy_config_overload_v3_ScaledTrigger_msginit = { NULL, &envoy_config_overload_v3_ScaledTrigger__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_overload_v3_Trigger_submsgs[2] = { @@ -68,7 +68,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_Trigger__fields[3] = { 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_submsgs[1] = { @@ -82,7 +82,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_ScaleTimersOverloadAct 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_submsgs[2] = { @@ -99,7 +99,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_ScaleTimersOverloadAct 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(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_overload_v3_OverloadAction_submsgs[2] = { @@ -116,7 +116,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_OverloadAction__fields 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field envoy_config_overload_v3_BufferFactoryConfig__fields[1] = { @@ -126,7 +126,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_BufferFactoryConfig__f 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_overload_v3_OverloadManager_submsgs[4] = { @@ -146,7 +146,7 @@ static const upb_MiniTable_Field envoy_config_overload_v3_OverloadManager__field 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[9] = { diff --git a/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h b/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h index 70555b69786..97d02f0b705 100644 --- a/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h +++ b/src/core/ext/upb-generated/envoy/config/overload/v3/overload.upb.h @@ -88,11 +88,15 @@ UPB_INLINE envoy_config_overload_v3_ResourceMonitor* envoy_config_overload_v3_Re return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ResourceMonitor_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_overload_v3_ResourceMonitor_config_type_typed_config = 3, @@ -158,11 +162,15 @@ UPB_INLINE envoy_config_overload_v3_ThresholdTrigger* envoy_config_overload_v3_T return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ThresholdTrigger_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -200,11 +208,15 @@ UPB_INLINE envoy_config_overload_v3_ScaledTrigger* envoy_config_overload_v3_Scal return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaledTrigger_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -251,11 +263,15 @@ UPB_INLINE envoy_config_overload_v3_Trigger* envoy_config_overload_v3_Trigger_pa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_Trigger_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_Trigger_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_overload_v3_Trigger_trigger_oneof_threshold = 2, @@ -343,11 +359,15 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig* envoy_confi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -397,11 +417,15 @@ UPB_INLINE envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer* return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_overload_v3_ScaleTimersOverloadActionConfig_ScaleTimer_overload_adjust_min_timeout = 2, @@ -489,11 +513,15 @@ UPB_INLINE envoy_config_overload_v3_OverloadAction* envoy_config_overload_v3_Ove return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadAction_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -574,11 +602,15 @@ UPB_INLINE envoy_config_overload_v3_BufferFactoryConfig* envoy_config_overload_v 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_BufferFactoryConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -616,11 +648,15 @@ UPB_INLINE envoy_config_overload_v3_OverloadManager* envoy_config_overload_v3_Ov 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_overload_v3_OverloadManager_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_overload_v3_OverloadManager_has_refresh_interval(const envoy_config_overload_v3_OverloadManager* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c b/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c index 70fa2815ae9..dac31037454 100644 --- a/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c +++ b/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.c @@ -38,7 +38,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_RBAC__fields[2] = { 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_rbac_v3_RBAC_PoliciesEntry_submsgs[1] = { @@ -73,7 +73,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_Policy__fields[4] = { 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_rbac_v3_Permission_submsgs[10] = { @@ -107,7 +107,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_Permission__fields[12] = { 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, 24), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(8, 16), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, }; static const upb_MiniTable_Sub envoy_config_rbac_v3_Permission_Set_submsgs[1] = { @@ -121,7 +121,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_Permission_Set__fields[1] 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_submsgs[10] = { @@ -154,7 +154,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_Principal__fields[11] = { 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, 24), 11, kUpb_ExtMode_NonExtendable, 11, 255, 0, + UPB_SIZE(8, 16), 11, kUpb_ExtMode_NonExtendable, 11, 255, 0, }; static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_Set_submsgs[1] = { @@ -168,7 +168,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_Principal_Set__fields[1] = 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_rbac_v3_Principal_Authenticated_submsgs[1] = { @@ -182,7 +182,7 @@ static const upb_MiniTable_Field envoy_config_rbac_v3_Principal_Authenticated__f 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, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[8] = { diff --git a/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h b/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h index b91e34d8ca2..457f52e0621 100644 --- a/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h +++ b/src/core/ext/upb-generated/envoy/config/rbac/v3/rbac.upb.h @@ -96,11 +96,15 @@ UPB_INLINE envoy_config_rbac_v3_RBAC* envoy_config_rbac_v3_RBAC_parse_ex(const c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_RBAC_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -183,11 +187,15 @@ UPB_INLINE envoy_config_rbac_v3_Policy* envoy_config_rbac_v3_Policy_parse_ex(con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Policy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Policy_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -302,11 +310,15 @@ UPB_INLINE envoy_config_rbac_v3_Permission* envoy_config_rbac_v3_Permission_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_rbac_v3_Permission_rule_and_rules = 1, @@ -587,11 +599,15 @@ UPB_INLINE envoy_config_rbac_v3_Permission_Set* envoy_config_rbac_v3_Permission_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Permission_Set_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -641,11 +657,15 @@ UPB_INLINE envoy_config_rbac_v3_Principal* envoy_config_rbac_v3_Principal_parse_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_rbac_v3_Principal_identifier_and_ids = 1, @@ -913,11 +933,15 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Set* envoy_config_rbac_v3_Principal_Se 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Set_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -967,11 +991,15 @@ UPB_INLINE envoy_config_rbac_v3_Principal_Authenticated* envoy_config_rbac_v3_Pr 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_rbac_v3_Principal_Authenticated_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c b/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c index 655df8bb619..1de1366ce6c 100644 --- a/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c +++ b/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.c @@ -50,7 +50,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteConfiguration__field 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(56, 120), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0, + UPB_SIZE(56, 112), 13, kUpb_ExtMode_NonExtendable, 13, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_ClusterSpecifierPlugin_submsgs[1] = { @@ -65,7 +65,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_ClusterSpecifierPlugin__f 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, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_Vhds_submsgs[1] = { @@ -79,7 +79,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_Vhds__fields[1] = { 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h b/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h index 61ae7c06504..b11d39a747b 100644 --- a/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h +++ b/src/core/ext/upb-generated/envoy/config/route/v3/route.upb.h @@ -71,11 +71,15 @@ UPB_INLINE envoy_config_route_v3_RouteConfiguration* envoy_config_route_v3_Route 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteConfiguration_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -338,11 +342,15 @@ UPB_INLINE envoy_config_route_v3_ClusterSpecifierPlugin* envoy_config_route_v3_C return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ClusterSpecifierPlugin_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_ClusterSpecifierPlugin_has_extension(const envoy_config_route_v3_ClusterSpecifierPlugin* msg) { return _upb_hasbit(msg, 1); @@ -402,11 +410,15 @@ UPB_INLINE envoy_config_route_v3_Vhds* envoy_config_route_v3_Vhds_parse_ex(const 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Vhds_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Vhds_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_Vhds_has_config_source(const envoy_config_route_v3_Vhds* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c b/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c index 4192ddddf2b..4c7a0c5c38b 100644 --- a/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c +++ b/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.c @@ -74,7 +74,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_VirtualHost__fields[20] = 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(84, 168), 20, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(88, 160), 20, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_VirtualHost_TypedPerFilterConfigEntry_submsgs[1] = { @@ -103,7 +103,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_FilterAction__fields[1] = 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_Route_submsgs[13] = { @@ -144,7 +144,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_Route__fields[16] = { 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(60, 120), 16, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(64, 112), 16, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_Route_TypedPerFilterConfigEntry_submsgs[1] = { @@ -204,7 +204,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_WeightedCluster_ClusterWe 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(60, 120), 10, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(64, 112), 10, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_WeightedCluster_ClusterWeight_TypedPerFilterConfigEntry_submsgs[1] = { @@ -251,13 +251,13 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteMatch__fields[11] = 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(44, 88), 11, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(48, 80), 11, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; const upb_MiniTable envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_submsgs[2] = { @@ -273,13 +273,13 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteMatch_TlsContextMatc 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; const upb_MiniTable envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_CorsPolicy_submsgs[4] = { @@ -367,7 +367,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction__fields[31] = 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(124, 232), 31, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(128, 224), 31, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_RequestMirrorPolicy_submsgs[2] = { @@ -384,7 +384,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_RequestMirror 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_submsgs[5] = { @@ -407,7 +407,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy__f 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(12, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(16, 16), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_Header_submsgs[1] = { @@ -422,7 +422,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_He 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_HashPolicy_Cookie_submsgs[1] = { @@ -438,7 +438,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Co 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, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[1] = { @@ -448,7 +448,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Co const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit = { NULL, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties__fields[0], - UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[1] = { @@ -458,7 +458,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Qu const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit = { NULL, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[1] = { @@ -468,7 +468,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_HashPolicy_Fi const upb_MiniTable envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit = { NULL, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_UpgradeConfig_submsgs[2] = { @@ -485,7 +485,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_UpgradeConfig 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_submsgs[1] = { @@ -500,7 +500,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_UpgradeConfig 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RouteAction_MaxStreamDuration_submsgs[3] = { @@ -518,7 +518,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RouteAction_MaxStreamDura 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_submsgs[10] = { @@ -568,7 +568,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryPriority 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryHostPredicate_submsgs[1] = { @@ -583,7 +583,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryHostPred 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RetryBackOff_submsgs[2] = { @@ -599,7 +599,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RetryBackOff_ 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_ResetHeader__fields[2] = { @@ -610,7 +610,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_ResetHeader__ const upb_MiniTable envoy_config_route_v3_RetryPolicy_ResetHeader_msginit = { NULL, &envoy_config_route_v3_RetryPolicy_ResetHeader__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_submsgs[2] = { @@ -626,7 +626,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RetryPolicy_RateLimitedRe 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_HedgePolicy_submsgs[2] = { @@ -643,7 +643,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_HedgePolicy__fields[3] = 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(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RedirectAction_submsgs[1] = { @@ -665,7 +665,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RedirectAction__fields[9] 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(44, 72), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(48, 72), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_DirectResponseAction_submsgs[1] = { @@ -680,13 +680,13 @@ static const upb_MiniTable_Field envoy_config_route_v3_DirectResponseAction__fie 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; const upb_MiniTable envoy_config_route_v3_NonForwardingAction_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_Decorator_submsgs[1] = { @@ -701,7 +701,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_Decorator__fields[2] = { 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_Tracing_submsgs[4] = { @@ -721,7 +721,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_Tracing__fields[4] = { 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_VirtualCluster_submsgs[1] = { @@ -736,7 +736,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_VirtualCluster__fields[2] 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_submsgs[3] = { @@ -755,7 +755,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit__fields[4] = { 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, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_submsgs[9] = { @@ -785,19 +785,19 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action__fields[ 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, 24), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, + UPB_SIZE(8, 16), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; const upb_MiniTable envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; const upb_MiniTable envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[3] = { @@ -809,13 +809,13 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_RequestH const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit = { NULL, &envoy_config_route_v3_RateLimit_Action_RequestHeaders__fields[0], - UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; const upb_MiniTable envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_GenericKey__fields[2] = { @@ -826,7 +826,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_GenericK const upb_MiniTable envoy_config_route_v3_RateLimit_Action_GenericKey_msginit = { NULL, &envoy_config_route_v3_RateLimit_Action_GenericKey__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_submsgs[2] = { @@ -844,7 +844,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_HeaderVa 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(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_DynamicMetaData_submsgs[1] = { @@ -860,7 +860,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_DynamicM 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, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Action_MetaData_submsgs[1] = { @@ -877,7 +877,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Action_MetaData 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(28, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Override_submsgs[1] = { @@ -891,7 +891,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Override__field 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_RateLimit_Override_DynamicMetadata_submsgs[1] = { @@ -905,7 +905,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_RateLimit_Override_Dynami 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_HeaderMatcher_submsgs[3] = { @@ -946,7 +946,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_QueryParameterMatcher__fi 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, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_InternalRedirectPolicy_submsgs[2] = { @@ -964,7 +964,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_InternalRedirectPolicy__f 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, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_FilterConfig_submsgs[1] = { @@ -979,7 +979,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_FilterConfig__fields[2] = 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[53] = { diff --git a/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h b/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h index ec0d1c0eb2f..866e2a577a6 100644 --- a/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h +++ b/src/core/ext/upb-generated/envoy/config/route/v3/route_components.upb.h @@ -279,11 +279,15 @@ UPB_INLINE envoy_config_route_v3_VirtualHost* envoy_config_route_v3_VirtualHost_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualHost_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -696,11 +700,15 @@ UPB_INLINE envoy_config_route_v3_FilterAction* envoy_config_route_v3_FilterActio return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_FilterAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_FilterAction_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_FilterAction_has_action(const envoy_config_route_v3_FilterAction* msg) { return _upb_hasbit(msg, 1); @@ -751,11 +759,15 @@ UPB_INLINE envoy_config_route_v3_Route* envoy_config_route_v3_Route_parse_ex(con 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Route_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Route_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_Route_action_route = 2, @@ -1136,11 +1148,15 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster* envoy_config_route_v3_Weighted 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_WeightedCluster_random_value_specifier_header_name = 4, @@ -1240,11 +1256,15 @@ UPB_INLINE envoy_config_route_v3_WeightedCluster_ClusterWeight* envoy_config_rou 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_WeightedCluster_ClusterWeight_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_WeightedCluster_ClusterWeight_host_rewrite_specifier_host_rewrite_literal = 11, @@ -1471,11 +1491,15 @@ UPB_INLINE envoy_config_route_v3_RouteMatch* envoy_config_route_v3_RouteMatch_pa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RouteMatch_path_specifier_prefix = 1, @@ -1731,11 +1755,15 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions* envoy_config_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_GrpcRouteMatchOptions_msginit, options, arena, &ptr, len); + return ptr; } @@ -1764,11 +1792,15 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* envoy_config return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_RouteMatch_TlsContextMatchOptions_has_presented(const envoy_config_route_v3_RouteMatch_TlsContextMatchOptions* msg) { return _upb_hasbit(msg, 1); @@ -1841,11 +1873,15 @@ UPB_INLINE envoy_config_route_v3_RouteMatch_ConnectMatcher* envoy_config_route_v 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteMatch_ConnectMatcher_msginit, options, arena, &ptr, len); + return ptr; } @@ -1874,11 +1910,15 @@ UPB_INLINE envoy_config_route_v3_CorsPolicy* envoy_config_route_v3_CorsPolicy_pa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_CorsPolicy_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_CorsPolicy_enabled_specifier_filter_enabled = 9, @@ -2036,11 +2076,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction* envoy_config_route_v3_RouteAction_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RouteAction_cluster_specifier_cluster = 1, @@ -2649,11 +2693,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_RequestMirrorPolicy* envoy_config_r return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_RequestMirrorPolicy_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2735,11 +2783,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy* envoy_config_route_v3_R return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RouteAction_HashPolicy_policy_specifier_header = 1, @@ -2893,11 +2945,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Header* envoy_config_rou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Header_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2957,11 +3013,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_Cookie* envoy_config_rou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_Cookie_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3030,11 +3090,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties* en return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_ConnectionProperties_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -3072,11 +3136,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter* envoy_co return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_QueryParameter_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3114,11 +3182,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_HashPolicy_FilterState* envoy_confi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_HashPolicy_FilterState_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3156,11 +3228,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig* envoy_config_route_v 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3242,11 +3318,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig* envoy_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_UpgradeConfig_ConnectConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3306,11 +3386,15 @@ UPB_INLINE envoy_config_route_v3_RouteAction_MaxStreamDuration* envoy_config_rou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RouteAction_MaxStreamDuration_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3405,11 +3489,15 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy* envoy_config_route_v3_RetryPolicy_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3687,11 +3775,15 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryPriority* envoy_config_route_v return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryPriority_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RetryPolicy_RetryPriority_config_type_typed_config = 3, @@ -3757,11 +3849,15 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryHostPredicate* envoy_config_ro return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryHostPredicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RetryPolicy_RetryHostPredicate_config_type_typed_config = 3, @@ -3827,11 +3923,15 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RetryBackOff* envoy_config_route_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RetryBackOff_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3904,11 +4004,15 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_ResetHeader* envoy_config_route_v3_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_ResetHeader_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -3955,11 +4059,15 @@ UPB_INLINE envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff* envoy_conf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RetryPolicy_RateLimitedRetryBackOff_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -4031,11 +4139,15 @@ UPB_INLINE envoy_config_route_v3_HedgePolicy* envoy_config_route_v3_HedgePolicy_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_HedgePolicy_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_HedgePolicy_has_initial_requests(const envoy_config_route_v3_HedgePolicy* msg) { return _upb_hasbit(msg, 1); @@ -4117,11 +4229,15 @@ UPB_INLINE envoy_config_route_v3_RedirectAction* envoy_config_route_v3_RedirectA 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RedirectAction_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RedirectAction_scheme_rewrite_specifier_https_redirect = 4, @@ -4272,11 +4388,15 @@ UPB_INLINE envoy_config_route_v3_DirectResponseAction* envoy_config_route_v3_Dir return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_DirectResponseAction_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -4336,11 +4456,15 @@ UPB_INLINE envoy_config_route_v3_NonForwardingAction* envoy_config_route_v3_NonF return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_NonForwardingAction_msginit, options, arena, &ptr, len); + return ptr; } @@ -4369,11 +4493,15 @@ UPB_INLINE envoy_config_route_v3_Decorator* envoy_config_route_v3_Decorator_pars 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Decorator_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Decorator_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -4433,11 +4561,15 @@ UPB_INLINE envoy_config_route_v3_Tracing* envoy_config_route_v3_Tracing_parse_ex return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Tracing_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_Tracing_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_Tracing_has_client_sampling(const envoy_config_route_v3_Tracing* msg) { return _upb_hasbit(msg, 1); @@ -4553,11 +4685,15 @@ UPB_INLINE envoy_config_route_v3_VirtualCluster* envoy_config_route_v3_VirtualCl 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_VirtualCluster_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -4616,11 +4752,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit* envoy_config_route_v3_RateLimit_pars 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_RateLimit_has_stage(const envoy_config_route_v3_RateLimit* msg) { return _upb_hasbit(msg, 1); @@ -4723,11 +4863,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action* envoy_config_route_v3_RateLim return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RateLimit_Action_action_specifier_source_cluster = 1, @@ -4960,11 +5104,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_SourceCluster* envoy_config_ro 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_SourceCluster_msginit, options, arena, &ptr, len); + return ptr; } @@ -4993,11 +5141,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DestinationCluster* envoy_conf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DestinationCluster_msginit, options, arena, &ptr, len); + return ptr; } @@ -5026,11 +5178,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RequestHeaders* envoy_config_r 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RequestHeaders_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -5086,11 +5242,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_RemoteAddress* envoy_config_ro return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_RemoteAddress_msginit, options, arena, &ptr, len); + return ptr; } @@ -5119,11 +5279,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_GenericKey* envoy_config_route 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_GenericKey_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -5170,11 +5334,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_HeaderValueMatch* envoy_config return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_HeaderValueMatch_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -5264,11 +5432,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_DynamicMetaData* envoy_config_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_DynamicMetaData_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -5337,11 +5509,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Action_MetaData* envoy_config_route_v 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Action_MetaData_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -5419,11 +5595,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override* envoy_config_route_v3_RateL return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_RateLimit_Override_override_specifier_dynamic_metadata = 1, @@ -5480,11 +5660,15 @@ UPB_INLINE envoy_config_route_v3_RateLimit_Override_DynamicMetadata* envoy_confi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_RateLimit_Override_DynamicMetadata_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -5535,11 +5719,15 @@ UPB_INLINE envoy_config_route_v3_HeaderMatcher* envoy_config_route_v3_HeaderMatc return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_HeaderMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_HeaderMatcher_header_match_specifier_exact_match = 4, @@ -5723,11 +5911,15 @@ UPB_INLINE envoy_config_route_v3_QueryParameterMatcher* envoy_config_route_v3_Qu return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_QueryParameterMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_QueryParameterMatcher_query_parameter_match_specifier_string_match = 5, @@ -5806,11 +5998,15 @@ UPB_INLINE envoy_config_route_v3_InternalRedirectPolicy* envoy_config_route_v3_I return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_InternalRedirectPolicy_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_InternalRedirectPolicy_has_max_internal_redirects(const envoy_config_route_v3_InternalRedirectPolicy* msg) { return _upb_hasbit(msg, 1); @@ -5906,11 +6102,15 @@ UPB_INLINE envoy_config_route_v3_FilterConfig* envoy_config_route_v3_FilterConfi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_FilterConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_route_v3_FilterConfig_has_config(const envoy_config_route_v3_FilterConfig* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c b/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c index 3f94b7899e1..0daff667317 100644 --- a/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c +++ b/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.c @@ -33,7 +33,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_ 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_config_route_v3_ScopedRouteConfiguration_Key_submsgs[1] = { @@ -47,7 +47,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_ 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[1] = { @@ -57,7 +57,7 @@ static const upb_MiniTable_Field envoy_config_route_v3_ScopedRouteConfiguration_ const upb_MiniTable envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit = { NULL, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment__fields[0], - UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h b/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h index 1710be85550..a632f1266ec 100644 --- a/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h +++ b/src/core/ext/upb-generated/envoy/config/route/v3/scoped_route.upb.h @@ -59,11 +59,15 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration* envoy_config_route_v3 return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -163,11 +167,15 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key* envoy_config_rout return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -217,11 +225,15 @@ UPB_INLINE envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment* envoy_co return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_route_v3_ScopedRouteConfiguration_Key_Fragment_type_string_key = 1, diff --git a/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c b/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c index b43711887f9..69479f914a0 100644 --- a/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c +++ b/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.c @@ -38,7 +38,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_TapConfig__fields[4] = { 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, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_MatchPredicate_submsgs[9] = { @@ -69,7 +69,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_MatchPredicate__fields[10] 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, + UPB_SIZE(8, 16), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_MatchPredicate_MatchSet_submsgs[1] = { @@ -83,7 +83,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_MatchPredicate_MatchSet__fi 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_HttpHeadersMatch_submsgs[1] = { @@ -97,7 +97,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_HttpHeadersMatch__fields[1] 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_HttpGenericBodyMatch_submsgs[1] = { @@ -112,7 +112,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch__field 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, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch__fields[2] = { @@ -123,7 +123,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_HttpGenericBodyMatch_Generi 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_OutputConfig_submsgs[3] = { @@ -142,7 +142,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_OutputConfig__fields[4] = { 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, + UPB_SIZE(16, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_OutputSink_submsgs[3] = { @@ -161,13 +161,13 @@ static const upb_MiniTable_Field envoy_config_tap_v3_OutputSink__fields[4] = { 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, + UPB_SIZE(16, 16), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_config_tap_v3_FilePerTapSink__fields[1] = { @@ -177,7 +177,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_FilePerTapSink__fields[1] = 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_tap_v3_StreamingGrpcSink_submsgs[1] = { @@ -192,7 +192,7 @@ static const upb_MiniTable_Field envoy_config_tap_v3_StreamingGrpcSink__fields[2 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[11] = { diff --git a/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h b/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h index 284483a1d70..0ca5fa18afc 100644 --- a/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h +++ b/src/core/ext/upb-generated/envoy/config/tap/v3/common.upb.h @@ -99,11 +99,15 @@ UPB_INLINE envoy_config_tap_v3_TapConfig* envoy_config_tap_v3_TapConfig_parse_ex 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_TapConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_tap_v3_TapConfig_has_match_config(const envoy_config_tap_v3_TapConfig* msg) { return _upb_hasbit(msg, 1); @@ -220,11 +224,15 @@ UPB_INLINE envoy_config_tap_v3_MatchPredicate* envoy_config_tap_v3_MatchPredicat 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_tap_v3_MatchPredicate_rule_or_match = 1, @@ -470,11 +478,15 @@ UPB_INLINE envoy_config_tap_v3_MatchPredicate_MatchSet* envoy_config_tap_v3_Matc 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_MatchPredicate_MatchSet_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -524,11 +536,15 @@ UPB_INLINE envoy_config_tap_v3_HttpHeadersMatch* envoy_config_tap_v3_HttpHeaders 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpHeadersMatch_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -578,11 +594,15 @@ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch* envoy_config_tap_v3_HttpGen 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -641,11 +661,15 @@ UPB_INLINE envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch* envoy_conf 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_tap_v3_HttpGenericBodyMatch_GenericTextMatch_rule_string_match = 1, @@ -706,11 +730,15 @@ UPB_INLINE envoy_config_tap_v3_OutputConfig* envoy_config_tap_v3_OutputConfig_pa 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -813,11 +841,15 @@ UPB_INLINE envoy_config_tap_v3_OutputSink* envoy_config_tap_v3_OutputSink_parse_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_OutputSink_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_tap_v3_OutputSink_output_sink_type_streaming_admin = 2, @@ -927,11 +959,15 @@ UPB_INLINE envoy_config_tap_v3_StreamingAdminSink* envoy_config_tap_v3_Streaming 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingAdminSink_msginit, options, arena, &ptr, len); + return ptr; } @@ -960,11 +996,15 @@ UPB_INLINE envoy_config_tap_v3_FilePerTapSink* envoy_config_tap_v3_FilePerTapSin 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_FilePerTapSink_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1002,11 +1042,15 @@ UPB_INLINE envoy_config_tap_v3_StreamingGrpcSink* envoy_config_tap_v3_StreamingG 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_tap_v3_StreamingGrpcSink_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c index e5101344cca..855c71ff63e 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.c @@ -24,7 +24,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_DatadogConfig__fields[2] 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h index 838ac9a8670..3113c2646d9 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/datadog.upb.h @@ -51,11 +51,15 @@ UPB_INLINE envoy_config_trace_v3_DatadogConfig* envoy_config_trace_v3_DatadogCon 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_DatadogConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c index 08a099d8482..b42bbdcd7ae 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_DynamicOtConfig__fields[2 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h index ea0d6ff6d7b..9b8745be264 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/dynamic_ot.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_trace_v3_DynamicOtConfig* envoy_config_trace_v3_DynamicO 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_DynamicOtConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c index ae191c5a820..e7ac581c245 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_Tracing__fields[1] = { 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_config_trace_v3_Tracing_Http_submsgs[1] = { @@ -42,7 +42,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_Tracing_Http__fields[2] = 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h index 0c03e76854f..2a3ec508c09 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/http_tracer.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_config_trace_v3_Tracing* envoy_config_trace_v3_Tracing_parse_ex 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_trace_v3_Tracing_has_http(const envoy_config_trace_v3_Tracing* msg) { return _upb_hasbit(msg, 1); @@ -111,11 +115,15 @@ UPB_INLINE envoy_config_trace_v3_Tracing_Http* envoy_config_trace_v3_Tracing_Htt return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_Tracing_Http_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_trace_v3_Tracing_Http_config_type_typed_config = 3, diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c index f237054c080..d7a1d556b80 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.c @@ -32,7 +32,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_LightstepConfig__fields[4 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, + UPB_SIZE(32, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h index 0f70e7129b6..388ecab1d6e 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/lightstep.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_config_trace_v3_LightstepConfig* envoy_config_trace_v3_Lightste 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_LightstepConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c index 55ec9ed4125..9fc1f8cfae7 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.c @@ -43,7 +43,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_OpenCensusConfig__fields[ 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, + UPB_SIZE(64, 112), 13, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h index 5f46c709dec..4c8e8670398 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/opencensus.upb.h @@ -63,11 +63,15 @@ UPB_INLINE envoy_config_trace_v3_OpenCensusConfig* envoy_config_trace_v3_OpenCen 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_OpenCensusConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_trace_v3_OpenCensusConfig_has_trace_config(const envoy_config_trace_v3_OpenCensusConfig* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c index a8334a5f5bd..f8dcbea6b61 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_TraceServiceConfig__field 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h index 206356c2a58..a1ff88de4d8 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/service.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_config_trace_v3_TraceServiceConfig* envoy_config_trace_v3_Trace 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_TraceServiceConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_trace_v3_TraceServiceConfig_has_grpc_service(const envoy_config_trace_v3_TraceServiceConfig* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c index 949a0969f76..6fd29d151f6 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_SkyWalkingConfig__fields[ 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_config_trace_v3_ClientConfig_submsgs[1] = { @@ -48,7 +48,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_ClientConfig__fields[4] = 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, + UPB_SIZE(40, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h index cf85456c6ee..6eba4aa85b5 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/skywalking.upb.h @@ -58,11 +58,15 @@ UPB_INLINE envoy_config_trace_v3_SkyWalkingConfig* envoy_config_trace_v3_SkyWalk 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_SkyWalkingConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_trace_v3_SkyWalkingConfig_has_grpc_service(const envoy_config_trace_v3_SkyWalkingConfig* msg) { return _upb_hasbit(msg, 1); @@ -135,11 +139,15 @@ UPB_INLINE envoy_config_trace_v3_ClientConfig* envoy_config_trace_v3_ClientConfi 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_ClientConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_config_trace_v3_ClientConfig_backend_token_specifier_backend_token = 3, diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c index b44a61343ee..db068743219 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.c @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_XRayConfig__fields[4] = { 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, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_config_trace_v3_XRayConfig_SegmentFields_submsgs[1] = { @@ -50,7 +50,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_XRayConfig_SegmentFields_ 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h index e04e9e66f7d..fb00760b9c1 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/xray.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_config_trace_v3_XRayConfig* envoy_config_trace_v3_XRayConfig_pa 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_config_trace_v3_XRayConfig_has_daemon_endpoint(const envoy_config_trace_v3_XRayConfig* msg) { return _upb_hasbit(msg, 1); @@ -168,11 +172,15 @@ UPB_INLINE envoy_config_trace_v3_XRayConfig_SegmentFields* envoy_config_trace_v3 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_XRayConfig_SegmentFields_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c b/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c index 4717205aa9c..39be1f2ed6a 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.c @@ -34,7 +34,7 @@ static const upb_MiniTable_Field envoy_config_trace_v3_ZipkinConfig__fields[6] = 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, + UPB_SIZE(40, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h b/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h index aa00f7cafdc..8ee7d142b84 100644 --- a/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h +++ b/src/core/ext/upb-generated/envoy/config/trace/v3/zipkin.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_config_trace_v3_ZipkinConfig* envoy_config_trace_v3_ZipkinConfi 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_config_trace_v3_ZipkinConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c b/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c index 8372af07fb2..61c5bf44060 100644 --- a/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field envoy_extensions_clusters_aggregate_v3_ClusterC const upb_MiniTable envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit = { NULL, &envoy_extensions_clusters_aggregate_v3_ClusterConfig__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h b/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h index 77d79ff2280..f69e6f35386 100644 --- a/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/clusters/aggregate/v3/cluster.upb.h @@ -51,11 +51,15 @@ UPB_INLINE envoy_extensions_clusters_aggregate_v3_ClusterConfig* envoy_extension 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_clusters_aggregate_v3_ClusterConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c b/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c index bf3012c1ae6..cba03ac0276 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.c @@ -38,7 +38,7 @@ const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_msginit const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_common_fault_v3_FaultRateLimit_submsgs[3] = { @@ -72,7 +72,7 @@ const upb_MiniTable envoy_extensions_filters_common_fault_v3_FaultRateLimit_Fixe 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[5] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h b/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h index 4ef74bd5348..e9d461d5921 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/filters/common/fault/v3/fault.upb.h @@ -71,11 +71,15 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay* envoy_extensions return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_common_fault_v3_FaultDelay_fault_delay_secifier_fixed_delay = 3, @@ -176,11 +180,15 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay* envo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultDelay_HeaderDelay_msginit, options, arena, &ptr, len); + return ptr; } @@ -209,11 +217,15 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit* envoy_extens return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_common_fault_v3_FaultRateLimit_limit_type_fixed_limit = 1, @@ -314,11 +326,15 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit* e return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_FixedLimit_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -356,11 +372,15 @@ UPB_INLINE envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit* return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_common_fault_v3_FaultRateLimit_HeaderLimit_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c b/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c index a8958537de6..c8bb2b5dbb1 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.c @@ -40,7 +40,7 @@ const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_msginit = const upb_MiniTable envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_http_fault_v3_HTTPFault_submsgs[5] = { @@ -72,7 +72,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_http_fault_v3_HTTPFaul 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(92, 184), 15, kUpb_ExtMode_NonExtendable, 15, 255, 0, + UPB_SIZE(96, 184), 15, kUpb_ExtMode_NonExtendable, 15, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h b/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h index 56b3a3e6756..4a106be1ded 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/fault/v3/fault.upb.h @@ -67,11 +67,15 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort* envoy_extensions_f return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_http_fault_v3_FaultAbort_error_type_http_status = 2, @@ -176,11 +180,15 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort* envoy_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_FaultAbort_HeaderAbort_msginit, options, arena, &ptr, len); + return ptr; } @@ -209,11 +217,15 @@ UPB_INLINE envoy_extensions_filters_http_fault_v3_HTTPFault* envoy_extensions_fi return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_fault_v3_HTTPFault_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c b/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c index 0749b5ec50d..a4cc5136eef 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_http_rbac_v3_RBAC__fie 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, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_http_rbac_v3_RBACPerRoute_submsgs[1] = { @@ -43,7 +43,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_http_rbac_v3_RBACPerRo 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h b/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h index 566f8db1f91..e1d9ef08bde 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/rbac/v3/rbac.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBAC* envoy_extensions_filters_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBAC_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -142,11 +146,15 @@ UPB_INLINE envoy_extensions_filters_http_rbac_v3_RBACPerRoute* envoy_extensions_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_rbac_v3_RBACPerRoute_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c b/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c index cc8cffbe45c..25f312c0eda 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.c @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_http_router_v3_Router_ 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(20, 40), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(24, 32), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h b/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h index 0dd9b54e580..ceccf3eb399 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/filters/http/router/v3/router.upb.h @@ -55,11 +55,15 @@ UPB_INLINE envoy_extensions_filters_http_router_v3_Router* envoy_extensions_filt return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_http_router_v3_Router_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c b/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c index c32836f89ff..e8b003c5c0c 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.c @@ -118,7 +118,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(192, 344), 47, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(192, 336), 47, kUpb_ExtMode_NonExtendable, 10, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_submsgs[6] = { @@ -143,7 +143,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(28, 56), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(32, 56), 7, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig__fields[1] = { @@ -153,7 +153,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_submsgs[1] = { @@ -171,7 +171,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(12, 24), 5, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 16), 5, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_submsgs[2] = { @@ -188,7 +188,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_submsgs[2] = { @@ -204,7 +204,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, + UPB_SIZE(16, 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] = { @@ -235,7 +235,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_submsgs[5] = { @@ -257,7 +257,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_Rds_submsgs[1] = { @@ -272,7 +272,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_submsgs[1] = { @@ -286,7 +286,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_submsgs[4] = { @@ -307,7 +307,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 48), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_submsgs[1] = { @@ -321,7 +321,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_submsgs[1] = { @@ -335,7 +335,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_submsgs[1] = { @@ -352,7 +352,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, 56), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Field envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement__fields[2] = { @@ -363,7 +363,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_submsgs[1] = { @@ -378,7 +378,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_submsgs[2] = { @@ -396,7 +396,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_submsgs[1] = { @@ -410,7 +410,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_submsgs[1] = { @@ -424,7 +424,7 @@ static const upb_MiniTable_Field envoy_extensions_filters_network_http_connectio 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[20] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h b/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h index 7da08721264..02df839573e 100644 --- a/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/filters/network/http_connection_manager/v3/http_connection_manager.upb.h @@ -188,11 +188,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_route_specifier_rds = 3, @@ -1046,11 +1050,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_Tracing_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1219,11 +1227,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_InternalAddressConfig_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -1261,11 +1273,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_SetCurrentClientCertDetails_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1352,11 +1368,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_UpgradeConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1437,11 +1457,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_PathNormalizationOptions_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1514,11 +1538,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpConne 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpConnectionManager_ProxyStatusConfig_proxy_name_use_node_id = 5, @@ -1615,11 +1643,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_LocalRepl 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_LocalReplyConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1691,11 +1723,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ResponseM return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ResponseMapper_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1833,11 +1869,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_Rds* envo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_Rds_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1897,11 +1937,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRouteConfigurationsList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1951,11 +1995,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_config_specifier_scoped_route_configurations_list = 4, @@ -2087,11 +2135,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -2141,11 +2193,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_type_header_value_extractor = 1, @@ -2202,11 +2258,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_extract_type_index = 3, @@ -2294,11 +2354,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRoutes_ScopeKeyBuilder_FragmentBuilder_HeaderValueExtractor_KvElement_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2345,11 +2409,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_ScopedRds_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2409,11 +2477,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_HttpFilte return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_filters_network_http_connection_manager_v3_HttpFilter_config_type_typed_config = 4, @@ -2510,11 +2582,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_RequestID return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_RequestIDExtension_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -2565,11 +2641,15 @@ UPB_INLINE envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobi 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_filters_network_http_connection_manager_v3_EnvoyMobileHttpConnectionManager_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h index 88ace25ead5..bf1b599f675 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/ring_hash/v3/ring_hash.upb.h @@ -61,11 +61,15 @@ UPB_INLINE envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* envoy return ret; } UPB_INLINE char* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_serialize(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, 0, arena, &ptr, len); + return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_serialize_ex(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg, int options, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, options, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash_clear_hash_function(const envoy_extensions_load_balancing_policies_ring_hash_v3_RingHash* msg) { *UPB_PTR_AT(msg, UPB_SIZE(4, 4), int32_t) = 0; diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c index 4e798231c59..0544401d58a 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_extensions_load_balancing_policies_wrr_lo const upb_MiniTable envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit = { &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_submsgs[0], &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h index 76e5ab36882..407af554d9d 100644 --- a/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/load_balancing_policies/wrr_locality/v3/wrr_locality.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* return ret; } UPB_INLINE char* envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_serialize(const envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, 0, arena, &ptr, len); + return ptr; } UPB_INLINE char* envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_serialize_ex(const envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg, int options, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, options, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality_has_endpoint_picking_policy(const envoy_extensions_load_balancing_policies_wrr_locality_v3_WrrLocality* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c index 894076fd34f..1d62fed20f0 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.c @@ -48,7 +48,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Priva 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, 40), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsCertificate_submsgs[8] = { @@ -76,7 +76,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsCe 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(36, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_submsgs[1] = { @@ -90,7 +90,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsSe 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance__fields[2] = { @@ -101,7 +101,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Certi 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_submsgs[1] = { @@ -116,7 +116,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Subje 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, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_submsgs[8] = { @@ -149,7 +149,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Certi 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(52, 104), 13, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(56, 96), 13, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[7] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h index 5e3220aa10b..dd3166af3b3 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/common.upb.h @@ -102,11 +102,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsParameters* envoy_extens return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsParameters_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -183,11 +187,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider* envoy_e return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_transport_sockets_tls_v3_PrivateKeyProvider_config_type_typed_config = 3, @@ -253,11 +261,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsCertificate* envoy_exten 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsCertificate_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -461,11 +473,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys* envoy return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsSessionTicketKeys_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -515,11 +531,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginIn 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateProviderPluginInstance_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -566,11 +586,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher* envo 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SubjectAltNameMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -630,11 +654,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CertificateValidationContex 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CertificateValidationContext_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c index f4870335224..8fefcb2cc2a 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.c @@ -30,7 +30,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Gener 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_submsgs[1] = { @@ -45,7 +45,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SdsSe 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_Secret_submsgs[4] = { @@ -66,7 +66,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Secre 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, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h index 3f8a571d280..9937d7b8894 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/secret.upb.h @@ -67,11 +67,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_GenericSecret* envoy_extens 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_GenericSecret_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -122,11 +126,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig* envoy_exte 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SdsSecretConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -186,11 +194,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_Secret* envoy_extensions_tr return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_Secret_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_transport_sockets_tls_v3_Secret_type_tls_certificate = 2, diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c index 350ecab6a64..d9941f2a779 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.c @@ -37,7 +37,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Upstr 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_submsgs[6] = { @@ -80,7 +80,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_TlsKe 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, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_submsgs[13] = { @@ -134,7 +134,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Commo 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance__fields[2] = { @@ -145,7 +145,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Commo 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_submsgs[4] = { @@ -165,7 +165,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_Commo 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[7] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h index d7451380d0b..d1c0533facd 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls.upb.h @@ -97,11 +97,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext* envoy_e return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_UpstreamTlsContext_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -192,11 +196,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext* envoy return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_transport_sockets_tls_v3_DownstreamTlsContext_session_ticket_keys_type_session_ticket_keys = 4, @@ -385,11 +393,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_TlsKeyLog* envoy_extensions 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_TlsKeyLog_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -469,11 +481,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext* envoy_ext 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_validation_context_type_validation_context = 3, @@ -807,11 +823,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProvider_config_typed_config = 2, @@ -877,11 +897,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_Certificat return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CertificateProviderInstance_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -928,11 +952,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCe return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_CommonTlsContext_CombinedCertificateValidationContext_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c index 791a89349d8..32386615b8a 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SPIFF 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_submsgs[1] = { @@ -41,7 +41,7 @@ static const upb_MiniTable_Field envoy_extensions_transport_sockets_tls_v3_SPIFF 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h index 067f4c1d785..1cb9437bbc2 100644 --- a/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h +++ b/src/core/ext/upb-generated/envoy/extensions/transport_sockets/tls/v3/tls_spiffe_validator_config.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig* 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -110,11 +114,15 @@ UPB_INLINE envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_T 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_extensions_transport_sockets_tls_v3_SPIFFECertValidatorConfig_TrustDomain_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c b/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c index 1aaf0190639..612a2c3f88b 100644 --- a/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c +++ b/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.c @@ -18,7 +18,7 @@ const upb_MiniTable envoy_service_discovery_v3_AdsDummy_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h b/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h index 4d226a3c2f2..5c8864686c8 100644 --- a/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h +++ b/src/core/ext/upb-generated/envoy/service/discovery/v3/ads.upb.h @@ -51,11 +51,15 @@ UPB_INLINE envoy_service_discovery_v3_AdsDummy* envoy_service_discovery_v3_AdsDu return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_AdsDummy_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c b/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c index 48888287c99..78b46f9bb80 100644 --- a/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c +++ b/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.c @@ -35,7 +35,7 @@ static const upb_MiniTable_Field envoy_service_discovery_v3_DiscoveryRequest__fi 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, 88), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 80), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_service_discovery_v3_DiscoveryResponse_submsgs[2] = { @@ -55,7 +55,7 @@ static const upb_MiniTable_Field envoy_service_discovery_v3_DiscoveryResponse__f 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(36, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub envoy_service_discovery_v3_DeltaDiscoveryRequest_submsgs[3] = { @@ -77,7 +77,7 @@ static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryReques 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, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 80), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryRequest_InitialResourceVersionsEntry__fields[2] = { @@ -108,7 +108,7 @@ static const upb_MiniTable_Field envoy_service_discovery_v3_DeltaDiscoveryRespon 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, 88), 6, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(40, 80), 6, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_service_discovery_v3_Resource_submsgs[3] = { @@ -129,7 +129,7 @@ static const upb_MiniTable_Field envoy_service_discovery_v3_Resource__fields[6] 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(36, 72), 6, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(40, 72), 6, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Field envoy_service_discovery_v3_Resource_CacheControl__fields[1] = { @@ -139,7 +139,7 @@ static const upb_MiniTable_Field envoy_service_discovery_v3_Resource_CacheContro const upb_MiniTable envoy_service_discovery_v3_Resource_CacheControl_msginit = { NULL, &envoy_service_discovery_v3_Resource_CacheControl__fields[0], - UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[7] = { diff --git a/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h b/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h index 4995ce95570..ef7ac910f26 100644 --- a/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h +++ b/src/core/ext/upb-generated/envoy/service/discovery/v3/discovery.upb.h @@ -79,11 +79,15 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryRequest* envoy_service_discovery_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryRequest_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -198,11 +202,15 @@ UPB_INLINE envoy_service_discovery_v3_DiscoveryResponse* envoy_service_discovery 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DiscoveryResponse_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -310,11 +318,15 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryRequest* envoy_service_disco 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryRequest_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_service_discovery_v3_DeltaDiscoveryRequest_has_node(const envoy_service_discovery_v3_DeltaDiscoveryRequest* msg) { return _upb_hasbit(msg, 1); @@ -477,11 +489,15 @@ UPB_INLINE envoy_service_discovery_v3_DeltaDiscoveryResponse* envoy_service_disc 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_DeltaDiscoveryResponse_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -595,11 +611,15 @@ UPB_INLINE envoy_service_discovery_v3_Resource* envoy_service_discovery_v3_Resou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -727,11 +747,15 @@ UPB_INLINE envoy_service_discovery_v3_Resource_CacheControl* envoy_service_disco 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_discovery_v3_Resource_CacheControl_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c b/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c index fcc3275ecb1..539f7ccb8eb 100644 --- a/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c +++ b/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.c @@ -30,7 +30,7 @@ static const upb_MiniTable_Field envoy_service_load_stats_v3_LoadStatsRequest__f 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_service_load_stats_v3_LoadStatsResponse_submsgs[1] = { @@ -47,7 +47,7 @@ static const upb_MiniTable_Field envoy_service_load_stats_v3_LoadStatsResponse__ 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(12, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(16, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h b/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h index ca56b9a3557..86c0e872ad3 100644 --- a/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h +++ b/src/core/ext/upb-generated/envoy/service/load_stats/v3/lrs.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsRequest* envoy_service_load_stat return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsRequest_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_service_load_stats_v3_LoadStatsRequest_has_node(const envoy_service_load_stats_v3_LoadStatsRequest* msg) { return _upb_hasbit(msg, 1); @@ -136,11 +140,15 @@ UPB_INLINE envoy_service_load_stats_v3_LoadStatsResponse* envoy_service_load_sta return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_load_stats_v3_LoadStatsResponse_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c b/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c index 620d5b66c92..faf41805f37 100644 --- a/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c +++ b/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.c @@ -34,7 +34,7 @@ static const upb_MiniTable_Field envoy_service_status_v3_ClientStatusRequest__fi 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_service_status_v3_PerXdsConfig_submsgs[5] = { @@ -76,7 +76,7 @@ static const upb_MiniTable_Field envoy_service_status_v3_ClientConfig__fields[3] 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub envoy_service_status_v3_ClientConfig_GenericXdsConfig_submsgs[3] = { @@ -100,7 +100,7 @@ static const upb_MiniTable_Field envoy_service_status_v3_ClientConfig_GenericXds 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, + UPB_SIZE(56, 88), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Sub envoy_service_status_v3_ClientStatusResponse_submsgs[1] = { @@ -114,7 +114,7 @@ static const upb_MiniTable_Field envoy_service_status_v3_ClientStatusResponse__f 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[5] = { diff --git a/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h b/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h index 72c75dcd10e..864215d2877 100644 --- a/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h +++ b/src/core/ext/upb-generated/envoy/service/status/v3/csds.upb.h @@ -98,11 +98,15 @@ UPB_INLINE envoy_service_status_v3_ClientStatusRequest* envoy_service_status_v3_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusRequest_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -174,11 +178,15 @@ UPB_INLINE envoy_service_status_v3_PerXdsConfig* envoy_service_status_v3_PerXdsC return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_PerXdsConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_service_status_v3_PerXdsConfig_per_xds_config_listener_config = 2, @@ -341,11 +349,15 @@ UPB_INLINE envoy_service_status_v3_ClientConfig* envoy_service_status_v3_ClientC return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_service_status_v3_ClientConfig_has_node(const envoy_service_status_v3_ClientConfig* msg) { return _upb_hasbit(msg, 1); @@ -438,11 +450,15 @@ UPB_INLINE envoy_service_status_v3_ClientConfig_GenericXdsConfig* envoy_service_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientConfig_GenericXdsConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -591,11 +607,15 @@ UPB_INLINE envoy_service_status_v3_ClientStatusResponse* envoy_service_status_v3 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_service_status_v3_ClientStatusResponse_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c b/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c index f0c0870ef8b..7fb008c9455 100644 --- a/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c +++ b/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field envoy_type_http_v3_Cookie__fields[3] = { 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, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h b/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h index 2c4dcc57e0b..0fcd828d07c 100644 --- a/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h +++ b/src/core/ext/upb-generated/envoy/type/http/v3/cookie.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_type_http_v3_Cookie* envoy_type_http_v3_Cookie_parse_ex(const c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_Cookie_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_Cookie_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c b/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c index 26a55699163..8f0d5e99af0 100644 --- a/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c +++ b/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.c @@ -25,7 +25,7 @@ static const upb_MiniTable_Field envoy_type_http_v3_PathTransformation__fields[1 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_type_http_v3_PathTransformation_Operation_submsgs[2] = { @@ -41,19 +41,19 @@ static const upb_MiniTable_Field envoy_type_http_v3_PathTransformation_Operation 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, + UPB_SIZE(8, 16), 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, + UPB_SIZE(0, 0), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[4] = { diff --git a/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h b/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h index 7690351f311..cd32ab126cb 100644 --- a/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h +++ b/src/core/ext/upb-generated/envoy/type/http/v3/path_transformation.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_type_http_v3_PathTransformation* envoy_type_http_v3_PathTransfo 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -114,11 +118,15 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation* envoy_type_http_v3_P 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_http_v3_PathTransformation_Operation_operation_specifier_normalize_path_rfc_3986 = 2, @@ -197,11 +205,15 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986* 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_NormalizePathRFC3986_msginit, options, arena, &ptr, len); + return ptr; } @@ -230,11 +242,15 @@ UPB_INLINE envoy_type_http_v3_PathTransformation_Operation_MergeSlashes* envoy_t 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_http_v3_PathTransformation_Operation_MergeSlashes_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c index 870febe0dc7..271aa37f737 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.c @@ -21,7 +21,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestHeaderMatchInp 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestTrailerMatchInput__fields[1] = { @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_HttpRequestTrailerMatchIn 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseHeaderMatchInput__fields[1] = { @@ -41,7 +41,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseHeaderMatchIn 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseTrailerMatchInput__fields[1] = { @@ -51,7 +51,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_HttpResponseTrailerMatchI 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[4] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h index e694dbcbec0..7cde1084203 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/http_inputs.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestHeaderMatchInput* envoy_type_matcher 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestHeaderMatchInput_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -102,11 +106,15 @@ UPB_INLINE envoy_type_matcher_v3_HttpRequestTrailerMatchInput* envoy_type_matche 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpRequestTrailerMatchInput_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -144,11 +152,15 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseHeaderMatchInput* envoy_type_matche 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseHeaderMatchInput_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -186,11 +198,15 @@ UPB_INLINE envoy_type_matcher_v3_HttpResponseTrailerMatchInput* envoy_type_match 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_HttpResponseTrailerMatchInput_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c index e8e9c471a57..bdf6825ad96 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher__fields[4 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[1] = { @@ -41,7 +41,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_MetadataMatcher_PathSegme const upb_MiniTable envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit = { NULL, &envoy_type_matcher_v3_MetadataMatcher_PathSegment__fields[0], - UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h index 8fe5bb857fa..52808c79520 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/metadata.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher* envoy_type_matcher_v3_Metadata 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -150,11 +154,15 @@ UPB_INLINE envoy_type_matcher_v3_MetadataMatcher_PathSegment* envoy_type_matcher 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_MetadataMatcher_PathSegment_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_MetadataMatcher_PathSegment_segment_key = 1, diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c index 768bd260e0b..003b9293f3f 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_NodeMatcher__fields[2] = 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h index 1c2cd1d70df..c0a41ff889e 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/node.upb.h @@ -55,11 +55,15 @@ UPB_INLINE envoy_type_matcher_v3_NodeMatcher* envoy_type_matcher_v3_NodeMatcher_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_NodeMatcher_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_type_matcher_v3_NodeMatcher_has_node_id(const envoy_type_matcher_v3_NodeMatcher* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c index 13ca6457a9c..a59aa8d1dd9 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_DoubleMatcher__fields[2] 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, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h index 8242e7a3082..bb17b247d56 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/number.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_type_matcher_v3_DoubleMatcher* envoy_type_matcher_v3_DoubleMatc 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_DoubleMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_DoubleMatcher_match_pattern_range = 1, diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c index 0293b407d9a..31ce5dbb251 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_PathMatcher__fields[1] = 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h index 85f433dcd31..21deddcd8b5 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/path.upb.h @@ -53,11 +53,15 @@ UPB_INLINE envoy_type_matcher_v3_PathMatcher* envoy_type_matcher_v3_PathMatcher_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_PathMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_PathMatcher_rule_path = 1, diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c index 29399dc5f2e..f1468732e35 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatcher__fields[2] = 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatcher_GoogleRE2_submsgs[1] = { @@ -43,7 +43,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatcher_GoogleRE2__f 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_type_matcher_v3_RegexMatchAndSubstitute_submsgs[1] = { @@ -58,7 +58,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_RegexMatchAndSubstitute__ 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, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h index 9b87e555f62..b7c12bf4a4c 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/regex.upb.h @@ -59,11 +59,15 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher* envoy_type_matcher_v3_RegexMatche return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_RegexMatcher_engine_type_google_re2 = 1, @@ -129,11 +133,15 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatcher_GoogleRE2* envoy_type_matcher_v3_R return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -184,11 +192,15 @@ UPB_INLINE envoy_type_matcher_v3_RegexMatchAndSubstitute* envoy_type_matcher_v3_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_RegexMatchAndSubstitute_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_type_matcher_v3_RegexMatchAndSubstitute_has_pattern(const envoy_type_matcher_v3_RegexMatchAndSubstitute* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c index 37bfaa05fba..8b702c4508f 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.c @@ -46,7 +46,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_ListStringMatcher__fields 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h index 7698ad3558b..332e2f145ad 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/string.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_type_matcher_v3_StringMatcher* envoy_type_matcher_v3_StringMatc return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_StringMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_StringMatcher_match_pattern_exact = 1, @@ -178,11 +182,15 @@ UPB_INLINE envoy_type_matcher_v3_ListStringMatcher* envoy_type_matcher_v3_ListSt return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListStringMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c index 71661bb1df6..4441fa487bd 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher__fields[2] 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher_PathSegment__fields[1] = { @@ -39,7 +39,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_StructMatcher_PathSegment const upb_MiniTable envoy_type_matcher_v3_StructMatcher_PathSegment_msginit = { NULL, &envoy_type_matcher_v3_StructMatcher_PathSegment__fields[0], - UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h index d525b8e2a70..e1f8e55843b 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/struct.upb.h @@ -56,11 +56,15 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher* envoy_type_matcher_v3_StructMatc return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -132,11 +136,15 @@ UPB_INLINE envoy_type_matcher_v3_StructMatcher_PathSegment* envoy_type_matcher_v 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_StructMatcher_PathSegment_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_StructMatcher_PathSegment_segment_key = 1, diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c b/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c index 528abf0647b..28b680088bc 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.c @@ -36,13 +36,13 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_ValueMatcher__fields[6] = 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, 24), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(8, 16), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; const upb_MiniTable envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub envoy_type_matcher_v3_ListMatcher_submsgs[1] = { @@ -56,7 +56,7 @@ static const upb_MiniTable_Field envoy_type_matcher_v3_ListMatcher__fields[1] = 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h b/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h index 3572aaed6ac..9f12e583128 100644 --- a/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h +++ b/src/core/ext/upb-generated/envoy/type/matcher/v3/value.upb.h @@ -61,11 +61,15 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher* envoy_type_matcher_v3_ValueMatche 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_ValueMatcher_match_pattern_null_match = 1, @@ -214,11 +218,15 @@ UPB_INLINE envoy_type_matcher_v3_ValueMatcher_NullMatch* envoy_type_matcher_v3_V 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ValueMatcher_NullMatch_msginit, options, arena, &ptr, len); + return ptr; } @@ -247,11 +255,15 @@ UPB_INLINE envoy_type_matcher_v3_ListMatcher* envoy_type_matcher_v3_ListMatcher_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_matcher_v3_ListMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_matcher_v3_ListMatcher_match_pattern_one_of = 1, diff --git a/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c b/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c index c1ccdf93968..3eee584cea3 100644 --- a/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c +++ b/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey__fields[2] = 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey_PathSegment__fields[1] = { @@ -37,7 +37,7 @@ static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKey_PathSegment_ const upb_MiniTable envoy_type_metadata_v3_MetadataKey_PathSegment_msginit = { NULL, &envoy_type_metadata_v3_MetadataKey_PathSegment__fields[0], - UPB_SIZE(12, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(16, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub envoy_type_metadata_v3_MetadataKind_submsgs[4] = { @@ -57,31 +57,31 @@ static const upb_MiniTable_Field envoy_type_metadata_v3_MetadataKind__fields[4] 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, 24), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(8, 16), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Route_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Cluster_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; const upb_MiniTable envoy_type_metadata_v3_MetadataKind_Host_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[7] = { diff --git a/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h b/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h index 4311d4b9f92..3623eb41e90 100644 --- a/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h +++ b/src/core/ext/upb-generated/envoy/type/metadata/v3/metadata.upb.h @@ -69,11 +69,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey* envoy_type_metadata_v3_MetadataKe return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -132,11 +136,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKey_PathSegment* envoy_type_metadata_v return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKey_PathSegment_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_metadata_v3_MetadataKey_PathSegment_segment_key = 1, @@ -184,11 +192,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind* envoy_type_metadata_v3_MetadataK return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_metadata_v3_MetadataKind_kind_request = 1, @@ -311,11 +323,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Request* envoy_type_metadata_v3_M return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Request_msginit, options, arena, &ptr, len); + return ptr; } @@ -344,11 +360,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Route* envoy_type_metadata_v3_Met return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Route_msginit, options, arena, &ptr, len); + return ptr; } @@ -377,11 +397,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Cluster* envoy_type_metadata_v3_M return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Cluster_msginit, options, arena, &ptr, len); + return ptr; } @@ -410,11 +434,15 @@ UPB_INLINE envoy_type_metadata_v3_MetadataKind_Host* envoy_type_metadata_v3_Meta return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_metadata_v3_MetadataKind_Host_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c b/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c index 00cb672f90f..3a48dec20b2 100644 --- a/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c +++ b/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.c @@ -34,7 +34,7 @@ static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag__fields[5] = { 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, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(16, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Literal__fields[1] = { @@ -44,7 +44,7 @@ static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Literal__fields const upb_MiniTable envoy_type_tracing_v3_CustomTag_Literal_msginit = { NULL, &envoy_type_tracing_v3_CustomTag_Literal__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Environment__fields[2] = { @@ -55,7 +55,7 @@ static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Environment__fi const upb_MiniTable envoy_type_tracing_v3_CustomTag_Environment_msginit = { NULL, &envoy_type_tracing_v3_CustomTag_Environment__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Header__fields[2] = { @@ -66,7 +66,7 @@ static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Header__fields[ const upb_MiniTable envoy_type_tracing_v3_CustomTag_Header_msginit = { NULL, &envoy_type_tracing_v3_CustomTag_Header__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub envoy_type_tracing_v3_CustomTag_Metadata_submsgs[2] = { @@ -83,7 +83,7 @@ static const upb_MiniTable_Field envoy_type_tracing_v3_CustomTag_Metadata__field 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[5] = { diff --git a/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h b/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h index cf906dc4550..d51fa4d4218 100644 --- a/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h +++ b/src/core/ext/upb-generated/envoy/type/tracing/v3/custom_tag.upb.h @@ -67,11 +67,15 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag* envoy_type_tracing_v3_CustomTag_pars return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_tracing_v3_CustomTag_type_literal = 2, @@ -203,11 +207,15 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Literal* envoy_type_tracing_v3_Custom return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Literal_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -245,11 +253,15 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Environment* envoy_type_tracing_v3_Cu return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Environment_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -296,11 +308,15 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Header* envoy_type_tracing_v3_CustomT return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Header_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -347,11 +363,15 @@ UPB_INLINE envoy_type_tracing_v3_CustomTag_Metadata* envoy_type_tracing_v3_Custo return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_tracing_v3_CustomTag_Metadata_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool envoy_type_tracing_v3_CustomTag_Metadata_has_kind(const envoy_type_tracing_v3_CustomTag_Metadata* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c b/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c index 43503147996..942f94fc23e 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.c @@ -28,13 +28,13 @@ static const upb_MiniTable_Field envoy_type_v3_HashPolicy__fields[2] = { 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, + UPB_SIZE(8, 16), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field envoy_type_v3_HashPolicy_FilterState__fields[1] = { @@ -44,7 +44,7 @@ static const upb_MiniTable_Field envoy_type_v3_HashPolicy_FilterState__fields[1] 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h b/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h index d28b28945c2..837de3c6590 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/hash_policy.upb.h @@ -57,11 +57,15 @@ UPB_INLINE envoy_type_v3_HashPolicy* envoy_type_v3_HashPolicy_parse_ex(const cha 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { envoy_type_v3_HashPolicy_policy_specifier_source_ip = 1, @@ -140,11 +144,15 @@ UPB_INLINE envoy_type_v3_HashPolicy_SourceIp* envoy_type_v3_HashPolicy_SourceIp_ 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_SourceIp_msginit, options, arena, &ptr, len); + return ptr; } @@ -173,11 +181,15 @@ UPB_INLINE envoy_type_v3_HashPolicy_FilterState* envoy_type_v3_HashPolicy_Filter 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HashPolicy_FilterState_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c b/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c index b6585e05c79..264107bc6c3 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field envoy_type_v3_HttpStatus__fields[1] = { 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h b/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h index fbeab3f6d05..6882f7d0835 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/http_status.upb.h @@ -111,11 +111,15 @@ UPB_INLINE envoy_type_v3_HttpStatus* envoy_type_v3_HttpStatus_parse_ex(const cha 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HttpStatus_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_HttpStatus_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h b/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h index bd05c3b9e1c..56be5a6800d 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/percent.upb.h @@ -60,11 +60,15 @@ UPB_INLINE envoy_type_v3_Percent* envoy_type_v3_Percent_parse_ex(const char* buf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_Percent_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_Percent_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -102,11 +106,15 @@ UPB_INLINE envoy_type_v3_FractionalPercent* envoy_type_v3_FractionalPercent_pars 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_FractionalPercent_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_FractionalPercent_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/type/v3/range.upb.c b/src/core/ext/upb-generated/envoy/type/v3/range.upb.c index 1f3dd9925f4..9f65e19ca46 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/range.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/range.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field envoy_type_v3_Int64Range__fields[2] = { const upb_MiniTable envoy_type_v3_Int64Range_msginit = { NULL, &envoy_type_v3_Int64Range__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field envoy_type_v3_Int32Range__fields[2] = { @@ -44,7 +44,7 @@ static const upb_MiniTable_Field envoy_type_v3_DoubleRange__fields[2] = { const upb_MiniTable envoy_type_v3_DoubleRange_msginit = { NULL, &envoy_type_v3_DoubleRange__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/envoy/type/v3/range.upb.h b/src/core/ext/upb-generated/envoy/type/v3/range.upb.h index 44cab47f939..a8ba4efb63d 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/range.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/range.upb.h @@ -57,11 +57,15 @@ UPB_INLINE envoy_type_v3_Int64Range* envoy_type_v3_Int64Range_parse_ex(const cha 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_Int64Range_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_Int64Range_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -108,11 +112,15 @@ UPB_INLINE envoy_type_v3_Int32Range* envoy_type_v3_Int32Range_parse_ex(const cha 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_Int32Range_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_Int32Range_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -159,11 +167,15 @@ UPB_INLINE envoy_type_v3_DoubleRange* envoy_type_v3_DoubleRange_parse_ex(const c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_DoubleRange_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_DoubleRange_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c b/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c index 7303c3bdd1b..38e75e0ec1b 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c +++ b/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.c @@ -23,7 +23,7 @@ static const upb_MiniTable_Field envoy_type_v3_SemanticVersion__fields[3] = { const upb_MiniTable envoy_type_v3_SemanticVersion_msginit = { NULL, &envoy_type_v3_SemanticVersion__fields[0], - UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h b/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h index 6b432685f06..98025bd5ac2 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/semantic_version.upb.h @@ -51,11 +51,15 @@ UPB_INLINE envoy_type_v3_SemanticVersion* envoy_type_v3_SemanticVersion_parse_ex 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_SemanticVersion_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_SemanticVersion_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h b/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h index f942f7a1d5a..7ebf2314c95 100644 --- a/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h +++ b/src/core/ext/upb-generated/envoy/type/v3/token_bucket.upb.h @@ -55,11 +55,15 @@ UPB_INLINE envoy_type_v3_TokenBucket* envoy_type_v3_TokenBucket_parse_ex(const c 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_TokenBucket_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &envoy_type_v3_TokenBucket_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/google/api/annotations.upb.h b/src/core/ext/upb-generated/google/api/annotations.upb.h index 30b3d2dd2c6..60df095cbaa 100644 --- a/src/core/ext/upb-generated/google/api/annotations.upb.h +++ b/src/core/ext/upb-generated/google/api/annotations.upb.h @@ -38,7 +38,7 @@ UPB_INLINE const struct google_api_HttpRule* google_api_http(const struct google } 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_Message_GetOrCreateExtension(msg, &google_api_http_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const struct google_api_HttpRule*) = ext; } diff --git a/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c b/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c index 47168707566..416ce312a8d 100644 --- a/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c +++ b/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.c @@ -32,7 +32,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_CheckedExpr__fields[4] 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(20, 40), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_CheckedExpr_ReferenceMapEntry_submsgs[1] = { @@ -94,7 +94,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Type__fields[13] = { 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(12, 24), 13, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(16, 24), 13, kUpb_ExtMode_NonExtendable, 12, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_ListType_submsgs[1] = { @@ -108,7 +108,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_ListType__fields[ 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, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_MapType_submsgs[2] = { @@ -124,7 +124,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_MapType__fields[2 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_FunctionType_submsgs[2] = { @@ -140,7 +140,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_FunctionType__fie 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Type_AbstractType_submsgs[1] = { @@ -155,7 +155,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Type_AbstractType__fie 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_submsgs[2] = { @@ -172,7 +172,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl__fields[3] = { 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_IdentDecl_submsgs[2] = { @@ -189,7 +189,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_IdentDecl__fields 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_FunctionDecl_submsgs[1] = { @@ -203,7 +203,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_FunctionDecl__fie 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_submsgs[2] = { @@ -223,7 +223,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Decl_FunctionDecl_Over 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, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Reference_submsgs[1] = { @@ -239,7 +239,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Reference__fields[3] = 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[13] = { diff --git a/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h b/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h index d7398c3d1ab..62875b994ca 100644 --- a/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h +++ b/src/core/ext/upb-generated/google/api/expr/v1alpha1/checked.upb.h @@ -112,11 +112,15 @@ UPB_INLINE google_api_expr_v1alpha1_CheckedExpr* google_api_expr_v1alpha1_Checke 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_CheckedExpr_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -279,11 +283,15 @@ UPB_INLINE google_api_expr_v1alpha1_Type* google_api_expr_v1alpha1_Type_parse_ex return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_api_expr_v1alpha1_Type_type_kind_dyn = 1, @@ -550,11 +558,15 @@ UPB_INLINE google_api_expr_v1alpha1_Type_ListType* google_api_expr_v1alpha1_Type return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_ListType_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -605,11 +617,15 @@ UPB_INLINE google_api_expr_v1alpha1_Type_MapType* google_api_expr_v1alpha1_Type_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_MapType_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -682,11 +698,15 @@ UPB_INLINE google_api_expr_v1alpha1_Type_FunctionType* google_api_expr_v1alpha1_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_FunctionType_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -758,11 +778,15 @@ UPB_INLINE google_api_expr_v1alpha1_Type_AbstractType* google_api_expr_v1alpha1_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Type_AbstractType_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -821,11 +845,15 @@ UPB_INLINE google_api_expr_v1alpha1_Decl* google_api_expr_v1alpha1_Decl_parse_ex return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_api_expr_v1alpha1_Decl_decl_kind_ident = 2, @@ -913,11 +941,15 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_IdentDecl* google_api_expr_v1alpha1_Dec return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_IdentDecl_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_api_expr_v1alpha1_Decl_IdentDecl_has_type(const google_api_expr_v1alpha1_Decl_IdentDecl* msg) { return _upb_hasbit(msg, 1); @@ -999,11 +1031,15 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl* google_api_expr_v1alpha1_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -1053,11 +1089,15 @@ UPB_INLINE google_api_expr_v1alpha1_Decl_FunctionDecl_Overload* google_api_expr_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Decl_FunctionDecl_Overload_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1171,11 +1211,15 @@ UPB_INLINE google_api_expr_v1alpha1_Reference* google_api_expr_v1alpha1_Referenc return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Reference_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c b/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c index ac2cacd3887..0056cca443d 100644 --- a/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c +++ b/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.c @@ -28,7 +28,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_ParsedExpr__fields[2] 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_submsgs[7] = { @@ -65,7 +65,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Ident__fields[1] const upb_MiniTable google_api_expr_v1alpha1_Expr_Ident_msginit = { NULL, &google_api_expr_v1alpha1_Expr_Ident__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Select_submsgs[1] = { @@ -81,7 +81,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Select__fields[3] 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, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_Call_submsgs[2] = { @@ -98,7 +98,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Call__fields[3] = 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(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateList_submsgs[1] = { @@ -112,7 +112,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateList__field 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(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateStruct_submsgs[1] = { @@ -127,7 +127,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_CreateStruct__fie 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Expr_CreateStruct_Entry_submsgs[2] = { @@ -169,7 +169,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_Expr_Comprehension__fi 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, 88), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 80), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Sub google_api_expr_v1alpha1_Constant_submsgs[2] = { @@ -211,7 +211,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo__fields[5] 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(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Field google_api_expr_v1alpha1_SourceInfo_PositionsEntry__fields[2] = { @@ -250,7 +250,7 @@ static const upb_MiniTable_Field google_api_expr_v1alpha1_SourcePosition__fields const upb_MiniTable google_api_expr_v1alpha1_SourcePosition_msginit = { NULL, &google_api_expr_v1alpha1_SourcePosition__fields[0], - UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[14] = { diff --git a/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h b/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h index 6867838df58..89570657a37 100644 --- a/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h +++ b/src/core/ext/upb-generated/google/api/expr/v1alpha1/syntax.upb.h @@ -94,11 +94,15 @@ UPB_INLINE google_api_expr_v1alpha1_ParsedExpr* google_api_expr_v1alpha1_ParsedE return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_ParsedExpr_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_api_expr_v1alpha1_ParsedExpr_has_expr(const google_api_expr_v1alpha1_ParsedExpr* msg) { return _upb_hasbit(msg, 1); @@ -171,11 +175,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr* google_api_expr_v1alpha1_Expr_parse_ex 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_api_expr_v1alpha1_Expr_expr_kind_const_expr = 3, @@ -373,11 +381,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Ident* google_api_expr_v1alpha1_Expr_Id 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Ident_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -415,11 +427,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Select* google_api_expr_v1alpha1_Expr_S 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Select_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_api_expr_v1alpha1_Expr_Select_has_operand(const google_api_expr_v1alpha1_Expr_Select* msg) { return _upb_hasbit(msg, 1); @@ -488,11 +504,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Call* google_api_expr_v1alpha1_Expr_Cal 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Call_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_api_expr_v1alpha1_Expr_Call_has_target(const google_api_expr_v1alpha1_Expr_Call* msg) { return _upb_hasbit(msg, 1); @@ -573,11 +593,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateList* google_api_expr_v1alpha1_Ex return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -627,11 +651,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct* google_api_expr_v1alpha1_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -690,11 +718,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_CreateStruct_Entry* google_api_expr_v1a return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_CreateStruct_Entry_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_api_expr_v1alpha1_Expr_CreateStruct_Entry_key_kind_field_key = 2, @@ -795,11 +827,15 @@ UPB_INLINE google_api_expr_v1alpha1_Expr_Comprehension* google_api_expr_v1alpha1 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Expr_Comprehension_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -956,11 +992,15 @@ UPB_INLINE google_api_expr_v1alpha1_Constant* google_api_expr_v1alpha1_Constant_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_Constant_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_api_expr_v1alpha1_Constant_constant_kind_null_value = 1, @@ -1130,11 +1170,15 @@ UPB_INLINE google_api_expr_v1alpha1_SourceInfo* google_api_expr_v1alpha1_SourceI return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourceInfo_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1283,11 +1327,15 @@ UPB_INLINE google_api_expr_v1alpha1_SourcePosition* google_api_expr_v1alpha1_Sou return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_expr_v1alpha1_SourcePosition_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/google/api/http.upb.c b/src/core/ext/upb-generated/google/api/http.upb.c index 803a09764eb..8a823e0c3a2 100644 --- a/src/core/ext/upb-generated/google/api/http.upb.c +++ b/src/core/ext/upb-generated/google/api/http.upb.c @@ -24,7 +24,7 @@ static const upb_MiniTable_Field google_api_Http__fields[2] = { const upb_MiniTable google_api_Http_msginit = { &google_api_Http_submsgs[0], &google_api_Http__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_api_HttpRule_submsgs[2] = { @@ -48,7 +48,7 @@ static const upb_MiniTable_Field google_api_HttpRule__fields[10] = { const upb_MiniTable google_api_HttpRule_msginit = { &google_api_HttpRule_submsgs[0], &google_api_HttpRule__fields[0], - UPB_SIZE(40, 88), 10, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 80), 10, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field google_api_CustomHttpPattern__fields[2] = { @@ -59,7 +59,7 @@ static const upb_MiniTable_Field google_api_CustomHttpPattern__fields[2] = { const upb_MiniTable google_api_CustomHttpPattern_msginit = { NULL, &google_api_CustomHttpPattern__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/google/api/http.upb.h b/src/core/ext/upb-generated/google/api/http.upb.h index 4b8cb177fca..afb5b754e95 100644 --- a/src/core/ext/upb-generated/google/api/http.upb.h +++ b/src/core/ext/upb-generated/google/api/http.upb.h @@ -57,11 +57,15 @@ UPB_INLINE google_api_Http* google_api_Http_parse_ex(const char* buf, size_t siz 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_Http_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_Http_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_api_Http_has_rules(const google_api_Http* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); @@ -120,11 +124,15 @@ UPB_INLINE google_api_HttpRule* google_api_HttpRule_parse_ex(const char* buf, si 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_api_HttpRule_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_HttpRule_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_api_HttpRule_pattern_get = 2, @@ -294,11 +302,15 @@ UPB_INLINE google_api_CustomHttpPattern* google_api_CustomHttpPattern_parse_ex(c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_CustomHttpPattern_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_CustomHttpPattern_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/google/api/httpbody.upb.c b/src/core/ext/upb-generated/google/api/httpbody.upb.c index adccaf3b848..832eb6b5da8 100644 --- a/src/core/ext/upb-generated/google/api/httpbody.upb.c +++ b/src/core/ext/upb-generated/google/api/httpbody.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field google_api_HttpBody__fields[3] = { 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, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/api/httpbody.upb.h b/src/core/ext/upb-generated/google/api/httpbody.upb.h index 0a5b1d2616c..19ef4ec0a77 100644 --- a/src/core/ext/upb-generated/google/api/httpbody.upb.h +++ b/src/core/ext/upb-generated/google/api/httpbody.upb.h @@ -53,11 +53,15 @@ UPB_INLINE google_api_HttpBody* google_api_HttpBody_parse_ex(const char* buf, si 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); + char* ptr; + (void)upb_Encode(msg, &google_api_HttpBody_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_api_HttpBody_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/google/protobuf/any.upb.c b/src/core/ext/upb-generated/google/protobuf/any.upb.c index 37c4cb884b0..9a6718b46c1 100644 --- a/src/core/ext/upb-generated/google/protobuf/any.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/any.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field google_protobuf_Any__fields[2] = { const upb_MiniTable google_protobuf_Any_msginit = { NULL, &google_protobuf_Any__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/protobuf/any.upb.h b/src/core/ext/upb-generated/google/protobuf/any.upb.h index 110ecef6e98..8ef20c3ab25 100644 --- a/src/core/ext/upb-generated/google/protobuf/any.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/any.upb.h @@ -51,11 +51,15 @@ UPB_INLINE google_protobuf_Any* google_protobuf_Any_parse_ex(const char* buf, si 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Any_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Any_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c b/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c index 8e627c16a27..59846b46b36 100644 --- a/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/descriptor.upb.c @@ -23,7 +23,7 @@ static const upb_MiniTable_Field google_protobuf_FileDescriptorSet__fields[1] = const upb_MiniTable google_protobuf_FileDescriptorSet_msginit = { &google_protobuf_FileDescriptorSet_submsgs[0], &google_protobuf_FileDescriptorSet__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_FileDescriptorProto_submsgs[6] = { @@ -53,7 +53,7 @@ static const upb_MiniTable_Field google_protobuf_FileDescriptorProto__fields[12] const upb_MiniTable google_protobuf_FileDescriptorProto_msginit = { &google_protobuf_FileDescriptorProto_submsgs[0], &google_protobuf_FileDescriptorProto__fields[0], - UPB_SIZE(64, 136), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, + UPB_SIZE(64, 128), 12, kUpb_ExtMode_NonExtendable, 12, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_DescriptorProto_submsgs[8] = { @@ -83,7 +83,7 @@ static const upb_MiniTable_Field google_protobuf_DescriptorProto__fields[10] = { const upb_MiniTable google_protobuf_DescriptorProto_msginit = { &google_protobuf_DescriptorProto_submsgs[0], &google_protobuf_DescriptorProto__fields[0], - UPB_SIZE(48, 104), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(48, 96), 10, kUpb_ExtMode_NonExtendable, 10, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_DescriptorProto_ExtensionRange_submsgs[1] = { @@ -110,7 +110,7 @@ static const upb_MiniTable_Field google_protobuf_DescriptorProto_ReservedRange__ const upb_MiniTable google_protobuf_DescriptorProto_ReservedRange_msginit = { NULL, &google_protobuf_DescriptorProto_ReservedRange__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_ExtensionRangeOptions_submsgs[1] = { @@ -124,7 +124,7 @@ static const upb_MiniTable_Field google_protobuf_ExtensionRangeOptions__fields[1 const upb_MiniTable google_protobuf_ExtensionRangeOptions_msginit = { &google_protobuf_ExtensionRangeOptions_submsgs[0], &google_protobuf_ExtensionRangeOptions__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_FieldDescriptorProto_submsgs[3] = { @@ -150,7 +150,7 @@ static const upb_MiniTable_Field google_protobuf_FieldDescriptorProto__fields[11 const upb_MiniTable google_protobuf_FieldDescriptorProto_msginit = { &google_protobuf_FieldDescriptorProto_submsgs[0], &google_protobuf_FieldDescriptorProto__fields[0], - UPB_SIZE(68, 120), 11, kUpb_ExtMode_NonExtendable, 10, 255, 0, + UPB_SIZE(72, 112), 11, kUpb_ExtMode_NonExtendable, 10, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_OneofDescriptorProto_submsgs[1] = { @@ -165,7 +165,7 @@ static const upb_MiniTable_Field google_protobuf_OneofDescriptorProto__fields[2] const upb_MiniTable google_protobuf_OneofDescriptorProto_msginit = { &google_protobuf_OneofDescriptorProto_submsgs[0], &google_protobuf_OneofDescriptorProto__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_EnumDescriptorProto_submsgs[3] = { @@ -185,7 +185,7 @@ static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto__fields[5] const upb_MiniTable google_protobuf_EnumDescriptorProto_msginit = { &google_protobuf_EnumDescriptorProto_submsgs[0], &google_protobuf_EnumDescriptorProto__fields[0], - UPB_SIZE(28, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(32, 56), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[2] = { @@ -196,7 +196,7 @@ static const upb_MiniTable_Field google_protobuf_EnumDescriptorProto_EnumReserve const upb_MiniTable google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit = { NULL, &google_protobuf_EnumDescriptorProto_EnumReservedRange__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_EnumValueDescriptorProto_submsgs[1] = { @@ -212,7 +212,7 @@ static const upb_MiniTable_Field google_protobuf_EnumValueDescriptorProto__field const upb_MiniTable google_protobuf_EnumValueDescriptorProto_msginit = { &google_protobuf_EnumValueDescriptorProto_submsgs[0], &google_protobuf_EnumValueDescriptorProto__fields[0], - UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_ServiceDescriptorProto_submsgs[2] = { @@ -229,7 +229,7 @@ static const upb_MiniTable_Field google_protobuf_ServiceDescriptorProto__fields[ const upb_MiniTable google_protobuf_ServiceDescriptorProto_msginit = { &google_protobuf_ServiceDescriptorProto_submsgs[0], &google_protobuf_ServiceDescriptorProto__fields[0], - UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_MethodDescriptorProto_submsgs[1] = { @@ -248,7 +248,7 @@ static const upb_MiniTable_Field google_protobuf_MethodDescriptorProto__fields[6 const upb_MiniTable google_protobuf_MethodDescriptorProto_msginit = { &google_protobuf_MethodDescriptorProto_submsgs[0], &google_protobuf_MethodDescriptorProto__fields[0], - UPB_SIZE(32, 72), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, + UPB_SIZE(32, 64), 6, kUpb_ExtMode_NonExtendable, 6, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_FileOptions_submsgs[2] = { @@ -283,7 +283,7 @@ static const upb_MiniTable_Field google_protobuf_FileOptions__fields[21] = { const upb_MiniTable google_protobuf_FileOptions_msginit = { &google_protobuf_FileOptions_submsgs[0], &google_protobuf_FileOptions__fields[0], - UPB_SIZE(104, 200), 21, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(104, 192), 21, kUpb_ExtMode_Extendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_MessageOptions_submsgs[1] = { @@ -301,7 +301,7 @@ static const upb_MiniTable_Field google_protobuf_MessageOptions__fields[5] = { const upb_MiniTable google_protobuf_MessageOptions_msginit = { &google_protobuf_MessageOptions_submsgs[0], &google_protobuf_MessageOptions__fields[0], - UPB_SIZE(12, 24), 5, kUpb_ExtMode_Extendable, 3, 255, 0, + UPB_SIZE(16, 16), 5, kUpb_ExtMode_Extendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_FieldOptions_submsgs[3] = { @@ -323,7 +323,7 @@ static const upb_MiniTable_Field google_protobuf_FieldOptions__fields[7] = { const upb_MiniTable google_protobuf_FieldOptions_msginit = { &google_protobuf_FieldOptions_submsgs[0], &google_protobuf_FieldOptions__fields[0], - UPB_SIZE(24, 40), 7, kUpb_ExtMode_Extendable, 3, 255, 0, + UPB_SIZE(24, 32), 7, kUpb_ExtMode_Extendable, 3, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_OneofOptions_submsgs[1] = { @@ -337,7 +337,7 @@ static const upb_MiniTable_Field google_protobuf_OneofOptions__fields[1] = { const upb_MiniTable google_protobuf_OneofOptions_msginit = { &google_protobuf_OneofOptions_submsgs[0], &google_protobuf_OneofOptions__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_Extendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_EnumOptions_submsgs[1] = { @@ -353,7 +353,7 @@ static const upb_MiniTable_Field google_protobuf_EnumOptions__fields[3] = { const upb_MiniTable google_protobuf_EnumOptions_msginit = { &google_protobuf_EnumOptions_submsgs[0], &google_protobuf_EnumOptions__fields[0], - UPB_SIZE(8, 24), 3, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_Extendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_EnumValueOptions_submsgs[1] = { @@ -368,7 +368,7 @@ static const upb_MiniTable_Field google_protobuf_EnumValueOptions__fields[2] = { const upb_MiniTable google_protobuf_EnumValueOptions_msginit = { &google_protobuf_EnumValueOptions_submsgs[0], &google_protobuf_EnumValueOptions__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_Extendable, 1, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_ServiceOptions_submsgs[1] = { @@ -383,7 +383,7 @@ static const upb_MiniTable_Field google_protobuf_ServiceOptions__fields[2] = { const upb_MiniTable google_protobuf_ServiceOptions_msginit = { &google_protobuf_ServiceOptions_submsgs[0], &google_protobuf_ServiceOptions__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_Extendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_MethodOptions_submsgs[2] = { @@ -400,7 +400,7 @@ static const upb_MiniTable_Field google_protobuf_MethodOptions__fields[3] = { const upb_MiniTable google_protobuf_MethodOptions_msginit = { &google_protobuf_MethodOptions_submsgs[0], &google_protobuf_MethodOptions__fields[0], - UPB_SIZE(12, 24), 3, kUpb_ExtMode_Extendable, 0, 255, 0, + UPB_SIZE(16, 16), 3, kUpb_ExtMode_Extendable, 0, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_UninterpretedOption_submsgs[1] = { @@ -431,7 +431,7 @@ static const upb_MiniTable_Field google_protobuf_UninterpretedOption_NamePart__f const upb_MiniTable google_protobuf_UninterpretedOption_NamePart_msginit = { NULL, &google_protobuf_UninterpretedOption_NamePart__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 2, }; static const upb_MiniTable_Sub google_protobuf_SourceCodeInfo_submsgs[1] = { @@ -445,7 +445,7 @@ static const upb_MiniTable_Field google_protobuf_SourceCodeInfo__fields[1] = { const upb_MiniTable google_protobuf_SourceCodeInfo_msginit = { &google_protobuf_SourceCodeInfo_submsgs[0], &google_protobuf_SourceCodeInfo__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_SourceCodeInfo_Location__fields[5] = { @@ -459,7 +459,7 @@ static const upb_MiniTable_Field google_protobuf_SourceCodeInfo_Location__fields const upb_MiniTable google_protobuf_SourceCodeInfo_Location_msginit = { NULL, &google_protobuf_SourceCodeInfo_Location__fields[0], - UPB_SIZE(32, 72), 5, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 5, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_GeneratedCodeInfo_submsgs[1] = { @@ -473,7 +473,7 @@ static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo__fields[1] = const upb_MiniTable google_protobuf_GeneratedCodeInfo_msginit = { &google_protobuf_GeneratedCodeInfo_submsgs[0], &google_protobuf_GeneratedCodeInfo__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_GeneratedCodeInfo_Annotation__fields[4] = { @@ -520,39 +520,39 @@ static const upb_MiniTable *messages_layout[27] = { }; const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Type_enuminit = { - NULL, - 0x7fffeULL, - 0, + NULL, + 0x7fffeULL, + 0, }; const upb_MiniTable_Enum google_protobuf_FieldDescriptorProto_Label_enuminit = { - NULL, - 0xeULL, - 0, + NULL, + 0xeULL, + 0, }; const upb_MiniTable_Enum google_protobuf_FileOptions_OptimizeMode_enuminit = { - NULL, - 0xeULL, - 0, + NULL, + 0xeULL, + 0, }; const upb_MiniTable_Enum google_protobuf_FieldOptions_CType_enuminit = { - NULL, - 0x7ULL, - 0, + NULL, + 0x7ULL, + 0, }; const upb_MiniTable_Enum google_protobuf_FieldOptions_JSType_enuminit = { - NULL, - 0x7ULL, - 0, + NULL, + 0x7ULL, + 0, }; const upb_MiniTable_Enum google_protobuf_MethodOptions_IdempotencyLevel_enuminit = { - NULL, - 0x7ULL, - 0, + NULL, + 0x7ULL, + 0, }; static const upb_MiniTable_Enum *enums_layout[6] = { diff --git a/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h b/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h index 0a7b892f338..1f782de848b 100644 --- a/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/descriptor.upb.h @@ -186,11 +186,15 @@ UPB_INLINE google_protobuf_FileDescriptorSet* google_protobuf_FileDescriptorSet_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorSet_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_FileDescriptorSet_has_file(const google_protobuf_FileDescriptorSet* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); @@ -240,11 +244,15 @@ UPB_INLINE google_protobuf_FileDescriptorProto* google_protobuf_FileDescriptorPr 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_FileDescriptorProto_has_name(const google_protobuf_FileDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -488,11 +496,15 @@ UPB_INLINE google_protobuf_DescriptorProto* google_protobuf_DescriptorProto_pars 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_DescriptorProto_has_name(const google_protobuf_DescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -719,11 +731,15 @@ UPB_INLINE google_protobuf_DescriptorProto_ExtensionRange* google_protobuf_Descr return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ExtensionRange_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_DescriptorProto_ExtensionRange_has_start(const google_protobuf_DescriptorProto_ExtensionRange* msg) { return _upb_hasbit(msg, 1); @@ -802,11 +818,15 @@ UPB_INLINE google_protobuf_DescriptorProto_ReservedRange* google_protobuf_Descri return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DescriptorProto_ReservedRange_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_DescriptorProto_ReservedRange_has_start(const google_protobuf_DescriptorProto_ReservedRange* msg) { return _upb_hasbit(msg, 1); @@ -863,11 +883,15 @@ UPB_INLINE google_protobuf_ExtensionRangeOptions* google_protobuf_ExtensionRange return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ExtensionRangeOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_ExtensionRangeOptions_has_uninterpreted_option(const google_protobuf_ExtensionRangeOptions* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); @@ -917,11 +941,15 @@ UPB_INLINE google_protobuf_FieldDescriptorProto* google_protobuf_FieldDescriptor 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_FieldDescriptorProto_has_name(const google_protobuf_FieldDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -1112,11 +1140,15 @@ UPB_INLINE google_protobuf_OneofDescriptorProto* google_protobuf_OneofDescriptor return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_OneofDescriptorProto_has_name(const google_protobuf_OneofDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -1181,11 +1213,15 @@ UPB_INLINE google_protobuf_EnumDescriptorProto* google_protobuf_EnumDescriptorPr return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_EnumDescriptorProto_has_name(const google_protobuf_EnumDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -1307,11 +1343,15 @@ UPB_INLINE google_protobuf_EnumDescriptorProto_EnumReservedRange* google_protobu return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumDescriptorProto_EnumReservedRange_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_EnumDescriptorProto_EnumReservedRange_has_start(const google_protobuf_EnumDescriptorProto_EnumReservedRange* msg) { return _upb_hasbit(msg, 1); @@ -1368,11 +1408,15 @@ UPB_INLINE google_protobuf_EnumValueDescriptorProto* google_protobuf_EnumValueDe return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_EnumValueDescriptorProto_has_name(const google_protobuf_EnumValueDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -1451,11 +1495,15 @@ UPB_INLINE google_protobuf_ServiceDescriptorProto* google_protobuf_ServiceDescri return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_ServiceDescriptorProto_has_name(const google_protobuf_ServiceDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -1541,11 +1589,15 @@ UPB_INLINE google_protobuf_MethodDescriptorProto* google_protobuf_MethodDescript 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodDescriptorProto_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_MethodDescriptorProto_has_name(const google_protobuf_MethodDescriptorProto* msg) { return _upb_hasbit(msg, 1); @@ -1666,11 +1718,15 @@ UPB_INLINE google_protobuf_FileOptions* google_protobuf_FileOptions_parse_ex(con 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FileOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_FileOptions_has_java_package(const google_protobuf_FileOptions* msg) { return _upb_hasbit(msg, 1); @@ -2000,11 +2056,15 @@ UPB_INLINE google_protobuf_MessageOptions* google_protobuf_MessageOptions_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MessageOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MessageOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_MessageOptions_has_message_set_wire_format(const google_protobuf_MessageOptions* msg) { return _upb_hasbit(msg, 1); @@ -2110,11 +2170,15 @@ UPB_INLINE google_protobuf_FieldOptions* google_protobuf_FieldOptions_parse_ex(c 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FieldOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_FieldOptions_has_ctype(const google_protobuf_FieldOptions* msg) { return _upb_hasbit(msg, 1); @@ -2248,11 +2312,15 @@ UPB_INLINE google_protobuf_OneofOptions* google_protobuf_OneofOptions_parse_ex(c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_OneofOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_OneofOptions_has_uninterpreted_option(const google_protobuf_OneofOptions* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); @@ -2302,11 +2370,15 @@ UPB_INLINE google_protobuf_EnumOptions* google_protobuf_EnumOptions_parse_ex(con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_EnumOptions_has_allow_alias(const google_protobuf_EnumOptions* msg) { return _upb_hasbit(msg, 1); @@ -2384,11 +2456,15 @@ UPB_INLINE google_protobuf_EnumValueOptions* google_protobuf_EnumValueOptions_pa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_EnumValueOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_EnumValueOptions_has_deprecated(const google_protobuf_EnumValueOptions* msg) { return _upb_hasbit(msg, 1); @@ -2452,11 +2528,15 @@ UPB_INLINE google_protobuf_ServiceOptions* google_protobuf_ServiceOptions_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ServiceOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_ServiceOptions_has_deprecated(const google_protobuf_ServiceOptions* msg) { return _upb_hasbit(msg, 1); @@ -2520,11 +2600,15 @@ UPB_INLINE google_protobuf_MethodOptions* google_protobuf_MethodOptions_parse_ex return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodOptions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_MethodOptions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_MethodOptions_has_deprecated(const google_protobuf_MethodOptions* msg) { return _upb_hasbit(msg, 1); @@ -2602,11 +2686,15 @@ UPB_INLINE google_protobuf_UninterpretedOption* google_protobuf_UninterpretedOpt 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_UninterpretedOption_has_name(const google_protobuf_UninterpretedOption* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(4, 8)); @@ -2740,11 +2828,15 @@ UPB_INLINE google_protobuf_UninterpretedOption_NamePart* google_protobuf_Uninter return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UninterpretedOption_NamePart_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_UninterpretedOption_NamePart_has_name_part(const google_protobuf_UninterpretedOption_NamePart* msg) { return _upb_hasbit(msg, 1); @@ -2801,11 +2893,15 @@ UPB_INLINE google_protobuf_SourceCodeInfo* google_protobuf_SourceCodeInfo_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_SourceCodeInfo_has_location(const google_protobuf_SourceCodeInfo* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); @@ -2855,11 +2951,15 @@ UPB_INLINE google_protobuf_SourceCodeInfo_Location* google_protobuf_SourceCodeIn return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_SourceCodeInfo_Location_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_SourceCodeInfo_Location_clear_path(const google_protobuf_SourceCodeInfo_Location* msg) { _upb_array_detach(msg, UPB_SIZE(4, 8)); @@ -2961,11 +3061,15 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo* google_protobuf_GeneratedCodeInfo_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_GeneratedCodeInfo_has_annotation(const google_protobuf_GeneratedCodeInfo* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); @@ -3015,11 +3119,15 @@ UPB_INLINE google_protobuf_GeneratedCodeInfo_Annotation* google_protobuf_Generat return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_GeneratedCodeInfo_Annotation_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_GeneratedCodeInfo_Annotation_clear_path(const google_protobuf_GeneratedCodeInfo_Annotation* msg) { _upb_array_detach(msg, UPB_SIZE(12, 16)); @@ -3084,7 +3192,7 @@ 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) +#define _UPB_MAXOPT_SIZE UPB_SIZE(104, 192) #ifdef __cplusplus } /* extern "C" */ diff --git a/src/core/ext/upb-generated/google/protobuf/duration.upb.c b/src/core/ext/upb-generated/google/protobuf/duration.upb.c index 1ff707e4b2b..d95bb374ef6 100644 --- a/src/core/ext/upb-generated/google/protobuf/duration.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/duration.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field google_protobuf_Duration__fields[2] = { const upb_MiniTable google_protobuf_Duration_msginit = { NULL, &google_protobuf_Duration__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/protobuf/duration.upb.h b/src/core/ext/upb-generated/google/protobuf/duration.upb.h index f012f1dc784..e766862e77d 100644 --- a/src/core/ext/upb-generated/google/protobuf/duration.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/duration.upb.h @@ -51,11 +51,15 @@ UPB_INLINE google_protobuf_Duration* google_protobuf_Duration_parse_ex(const cha 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Duration_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Duration_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_Duration_clear_seconds(const google_protobuf_Duration* msg) { *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0; diff --git a/src/core/ext/upb-generated/google/protobuf/empty.upb.c b/src/core/ext/upb-generated/google/protobuf/empty.upb.c index be9a6612504..0baf7664ab7 100644 --- a/src/core/ext/upb-generated/google/protobuf/empty.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/empty.upb.c @@ -15,7 +15,7 @@ const upb_MiniTable google_protobuf_Empty_msginit = { NULL, NULL, - UPB_SIZE(0, 8), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/protobuf/empty.upb.h b/src/core/ext/upb-generated/google/protobuf/empty.upb.h index 0194b9aa337..477ef006994 100644 --- a/src/core/ext/upb-generated/google/protobuf/empty.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/empty.upb.h @@ -51,11 +51,15 @@ UPB_INLINE google_protobuf_Empty* google_protobuf_Empty_parse_ex(const char* buf return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Empty_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Empty_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/google/protobuf/struct.upb.c b/src/core/ext/upb-generated/google/protobuf/struct.upb.c index 09b3813e3e5..5183b64e5ec 100644 --- a/src/core/ext/upb-generated/google/protobuf/struct.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/struct.upb.c @@ -23,7 +23,7 @@ static const upb_MiniTable_Field google_protobuf_Struct__fields[1] = { const upb_MiniTable google_protobuf_Struct_msginit = { &google_protobuf_Struct_submsgs[0], &google_protobuf_Struct__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub google_protobuf_Struct_FieldsEntry_submsgs[1] = { @@ -72,7 +72,7 @@ static const upb_MiniTable_Field google_protobuf_ListValue__fields[1] = { const upb_MiniTable google_protobuf_ListValue_msginit = { &google_protobuf_ListValue_submsgs[0], &google_protobuf_ListValue__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[4] = { diff --git a/src/core/ext/upb-generated/google/protobuf/struct.upb.h b/src/core/ext/upb-generated/google/protobuf/struct.upb.h index 29cfef15ad7..d4ec05bc7e7 100644 --- a/src/core/ext/upb-generated/google/protobuf/struct.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/struct.upb.h @@ -64,11 +64,15 @@ UPB_INLINE google_protobuf_Struct* google_protobuf_Struct_parse_ex(const char* b 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Struct_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Struct_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_Struct_has_fields(const google_protobuf_Struct* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); @@ -142,11 +146,15 @@ UPB_INLINE google_protobuf_Value* google_protobuf_Value_parse_ex(const char* buf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Value_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Value_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { google_protobuf_Value_kind_null_value = 1, @@ -277,11 +285,15 @@ UPB_INLINE google_protobuf_ListValue* google_protobuf_ListValue_parse_ex(const c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ListValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_ListValue_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool google_protobuf_ListValue_has_values(const google_protobuf_ListValue* msg) { return _upb_has_submsg_nohasbit(msg, UPB_SIZE(0, 0)); diff --git a/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c b/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c index ab4d58807fd..5283d8c8a67 100644 --- a/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/timestamp.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field google_protobuf_Timestamp__fields[2] = { const upb_MiniTable google_protobuf_Timestamp_msginit = { NULL, &google_protobuf_Timestamp__fields[0], - UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h b/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h index 24060daef2c..089a56cf601 100644 --- a/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/timestamp.upb.h @@ -51,11 +51,15 @@ UPB_INLINE google_protobuf_Timestamp* google_protobuf_Timestamp_parse_ex(const c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Timestamp_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Timestamp_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_Timestamp_clear_seconds(const google_protobuf_Timestamp* msg) { *UPB_PTR_AT(msg, UPB_SIZE(8, 8), int64_t) = 0; diff --git a/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c b/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c index cff3e1c5ac7..6ac414ef1ae 100644 --- a/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c +++ b/src/core/ext/upb-generated/google/protobuf/wrappers.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field google_protobuf_FloatValue__fields[1] = { const upb_MiniTable google_protobuf_FloatValue_msginit = { NULL, &google_protobuf_FloatValue__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_Int64Value__fields[1] = { @@ -59,7 +59,7 @@ static const upb_MiniTable_Field google_protobuf_Int32Value__fields[1] = { const upb_MiniTable google_protobuf_Int32Value_msginit = { NULL, &google_protobuf_Int32Value__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_UInt32Value__fields[1] = { @@ -69,7 +69,7 @@ static const upb_MiniTable_Field google_protobuf_UInt32Value__fields[1] = { const upb_MiniTable google_protobuf_UInt32Value_msginit = { NULL, &google_protobuf_UInt32Value__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_BoolValue__fields[1] = { @@ -79,7 +79,7 @@ static const upb_MiniTable_Field google_protobuf_BoolValue__fields[1] = { const upb_MiniTable google_protobuf_BoolValue_msginit = { NULL, &google_protobuf_BoolValue__fields[0], - UPB_SIZE(1, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_StringValue__fields[1] = { @@ -89,7 +89,7 @@ static const upb_MiniTable_Field google_protobuf_StringValue__fields[1] = { const upb_MiniTable google_protobuf_StringValue_msginit = { NULL, &google_protobuf_StringValue__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field google_protobuf_BytesValue__fields[1] = { @@ -99,7 +99,7 @@ static const upb_MiniTable_Field google_protobuf_BytesValue__fields[1] = { const upb_MiniTable google_protobuf_BytesValue_msginit = { NULL, &google_protobuf_BytesValue__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[9] = { diff --git a/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h b/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h index 31541a0c95c..d730b28d800 100644 --- a/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h +++ b/src/core/ext/upb-generated/google/protobuf/wrappers.upb.h @@ -75,11 +75,15 @@ UPB_INLINE google_protobuf_DoubleValue* google_protobuf_DoubleValue_parse_ex(con 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DoubleValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_DoubleValue_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_DoubleValue_clear_value(const google_protobuf_DoubleValue* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), double) = 0; @@ -117,11 +121,15 @@ UPB_INLINE google_protobuf_FloatValue* google_protobuf_FloatValue_parse_ex(const 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FloatValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_FloatValue_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_FloatValue_clear_value(const google_protobuf_FloatValue* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), float) = 0; @@ -159,11 +167,15 @@ UPB_INLINE google_protobuf_Int64Value* google_protobuf_Int64Value_parse_ex(const 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Int64Value_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Int64Value_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_Int64Value_clear_value(const google_protobuf_Int64Value* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int64_t) = 0; @@ -201,11 +213,15 @@ UPB_INLINE google_protobuf_UInt64Value* google_protobuf_UInt64Value_parse_ex(con 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UInt64Value_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UInt64Value_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_UInt64Value_clear_value(const google_protobuf_UInt64Value* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint64_t) = 0; @@ -243,11 +259,15 @@ UPB_INLINE google_protobuf_Int32Value* google_protobuf_Int32Value_parse_ex(const 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Int32Value_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_Int32Value_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_Int32Value_clear_value(const google_protobuf_Int32Value* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; @@ -285,11 +305,15 @@ UPB_INLINE google_protobuf_UInt32Value* google_protobuf_UInt32Value_parse_ex(con 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UInt32Value_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_UInt32Value_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_UInt32Value_clear_value(const google_protobuf_UInt32Value* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0; @@ -327,11 +351,15 @@ UPB_INLINE google_protobuf_BoolValue* google_protobuf_BoolValue_parse_ex(const c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_BoolValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_BoolValue_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_protobuf_BoolValue_clear_value(const google_protobuf_BoolValue* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), bool) = 0; @@ -369,11 +397,15 @@ UPB_INLINE google_protobuf_StringValue* google_protobuf_StringValue_parse_ex(con 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_StringValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_StringValue_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -411,11 +443,15 @@ UPB_INLINE google_protobuf_BytesValue* google_protobuf_BytesValue_parse_ex(const 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_BytesValue_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_protobuf_BytesValue_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/google/rpc/status.upb.c b/src/core/ext/upb-generated/google/rpc/status.upb.c index 7222380d317..c215e1b2fac 100644 --- a/src/core/ext/upb-generated/google/rpc/status.upb.c +++ b/src/core/ext/upb-generated/google/rpc/status.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field google_rpc_Status__fields[3] = { const upb_MiniTable google_rpc_Status_msginit = { &google_rpc_Status_submsgs[0], &google_rpc_Status__fields[0], - UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/rpc/status.upb.h b/src/core/ext/upb-generated/google/rpc/status.upb.h index 65bcadd472b..1a4a95d7c06 100644 --- a/src/core/ext/upb-generated/google/rpc/status.upb.h +++ b/src/core/ext/upb-generated/google/rpc/status.upb.h @@ -53,11 +53,15 @@ UPB_INLINE google_rpc_Status* google_rpc_Status_parse_ex(const char* buf, size_t 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_rpc_Status_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &google_rpc_Status_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_rpc_Status_clear_code(const google_rpc_Status* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), int32_t) = 0; diff --git a/src/core/ext/upb-generated/google/type/expr.upb.c b/src/core/ext/upb-generated/google/type/expr.upb.c index 81cd98ad02b..183191b170a 100644 --- a/src/core/ext/upb-generated/google/type/expr.upb.c +++ b/src/core/ext/upb-generated/google/type/expr.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field google_type_Expr__fields[4] = { const upb_MiniTable google_type_Expr_msginit = { NULL, &google_type_Expr__fields[0], - UPB_SIZE(32, 72), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/google/type/expr.upb.h b/src/core/ext/upb-generated/google/type/expr.upb.h index 173d0666467..d4b8db6f878 100644 --- a/src/core/ext/upb-generated/google/type/expr.upb.h +++ b/src/core/ext/upb-generated/google/type/expr.upb.h @@ -51,11 +51,15 @@ UPB_INLINE google_type_Expr* google_type_Expr_parse_ex(const char* buf, size_t s return ret; } UPB_INLINE char* google_type_Expr_serialize(const google_type_Expr* msg, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &google_type_Expr_msginit, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_type_Expr_msginit, 0, arena, &ptr, len); + return ptr; } UPB_INLINE char* google_type_Expr_serialize_ex(const google_type_Expr* msg, int options, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &google_type_Expr_msginit, options, arena, len); + char* ptr; + (void)upb_Encode(msg, &google_type_Expr_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void google_type_Expr_clear_expression(const google_type_Expr* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), upb_StringView) = upb_StringView_FromDataAndSize(NULL, 0); diff --git a/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c b/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c index 7537d2e31d1..20737272258 100644 --- a/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c +++ b/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.c @@ -31,7 +31,7 @@ static const upb_MiniTable_Field opencensus_proto_trace_v1_TraceConfig__fields[7 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, + UPB_SIZE(40, 48), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Field opencensus_proto_trace_v1_ProbabilitySampler__fields[1] = { @@ -51,7 +51,7 @@ static const upb_MiniTable_Field opencensus_proto_trace_v1_ConstantSampler__fiel 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field opencensus_proto_trace_v1_RateLimitingSampler__fields[1] = { diff --git a/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h b/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h index a6c68c0a3e4..7915939a835 100644 --- a/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h +++ b/src/core/ext/upb-generated/opencensus/proto/trace/v1/trace_config.upb.h @@ -66,11 +66,15 @@ UPB_INLINE opencensus_proto_trace_v1_TraceConfig* opencensus_proto_trace_v1_Trac 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_TraceConfig_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { opencensus_proto_trace_v1_TraceConfig_sampler_probability_sampler = 1, @@ -207,11 +211,15 @@ UPB_INLINE opencensus_proto_trace_v1_ProbabilitySampler* opencensus_proto_trace_ 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ProbabilitySampler_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -249,11 +257,15 @@ UPB_INLINE opencensus_proto_trace_v1_ConstantSampler* opencensus_proto_trace_v1_ 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_ConstantSampler_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -291,11 +303,15 @@ UPB_INLINE opencensus_proto_trace_v1_RateLimitingSampler* opencensus_proto_trace 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &opencensus_proto_trace_v1_RateLimitingSampler_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h index ec0a608218f..e4b6e44010d 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/altscontext.upb.h @@ -56,11 +56,15 @@ UPB_INLINE grpc_gcp_AltsContext* grpc_gcp_AltsContext_parse_ex(const char* buf, return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_AltsContext_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_AltsContext_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c index d35f3007a35..c16c5ac08da 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.c @@ -38,7 +38,7 @@ static const upb_MiniTable_Field grpc_gcp_Identity__fields[3] = { const upb_MiniTable grpc_gcp_Identity_msginit = { &grpc_gcp_Identity_submsgs[0], &grpc_gcp_Identity__fields[0], - UPB_SIZE(16, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field grpc_gcp_Identity_AttributesEntry__fields[2] = { @@ -91,7 +91,7 @@ static const upb_MiniTable_Field grpc_gcp_ServerHandshakeParameters__fields[2] = const upb_MiniTable grpc_gcp_ServerHandshakeParameters_msginit = { &grpc_gcp_ServerHandshakeParameters_submsgs[0], &grpc_gcp_ServerHandshakeParameters__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub grpc_gcp_StartServerHandshakeReq_submsgs[4] = { @@ -114,7 +114,7 @@ static const upb_MiniTable_Field grpc_gcp_StartServerHandshakeReq__fields[7] = { const upb_MiniTable grpc_gcp_StartServerHandshakeReq_msginit = { &grpc_gcp_StartServerHandshakeReq_submsgs[0], &grpc_gcp_StartServerHandshakeReq__fields[0], - UPB_SIZE(36, 72), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, + UPB_SIZE(40, 64), 7, kUpb_ExtMode_NonExtendable, 7, 255, 0, }; static const upb_MiniTable_Sub grpc_gcp_StartServerHandshakeReq_HandshakeParametersEntry_submsgs[1] = { @@ -139,7 +139,7 @@ static const upb_MiniTable_Field grpc_gcp_NextHandshakeMessageReq__fields[1] = { const upb_MiniTable grpc_gcp_NextHandshakeMessageReq_msginit = { NULL, &grpc_gcp_NextHandshakeMessageReq__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub grpc_gcp_HandshakerReq_submsgs[3] = { @@ -157,7 +157,7 @@ static const upb_MiniTable_Field grpc_gcp_HandshakerReq__fields[3] = { const upb_MiniTable grpc_gcp_HandshakerReq_msginit = { &grpc_gcp_HandshakerReq_submsgs[0], &grpc_gcp_HandshakerReq__fields[0], - UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub grpc_gcp_HandshakerResult_submsgs[3] = { @@ -180,7 +180,7 @@ static const upb_MiniTable_Field grpc_gcp_HandshakerResult__fields[8] = { const upb_MiniTable grpc_gcp_HandshakerResult_msginit = { &grpc_gcp_HandshakerResult_submsgs[0], &grpc_gcp_HandshakerResult__fields[0], - UPB_SIZE(44, 88), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(48, 80), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field grpc_gcp_HandshakerStatus__fields[2] = { @@ -191,7 +191,7 @@ static const upb_MiniTable_Field grpc_gcp_HandshakerStatus__fields[2] = { const upb_MiniTable grpc_gcp_HandshakerStatus_msginit = { NULL, &grpc_gcp_HandshakerStatus__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub grpc_gcp_HandshakerResp_submsgs[2] = { diff --git a/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h index 78020198cd0..8f35fb37006 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/handshaker.upb.h @@ -98,11 +98,15 @@ UPB_INLINE grpc_gcp_Endpoint* grpc_gcp_Endpoint_parse_ex(const char* buf, size_t return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_Endpoint_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_Endpoint_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -158,11 +162,15 @@ UPB_INLINE grpc_gcp_Identity* grpc_gcp_Identity_parse_ex(const char* buf, size_t return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_Identity_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_Identity_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { grpc_gcp_Identity_identity_oneof_service_account = 1, @@ -265,11 +273,15 @@ UPB_INLINE grpc_gcp_StartClientHandshakeReq* grpc_gcp_StartClientHandshakeReq_pa 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_StartClientHandshakeReq_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -464,11 +476,15 @@ UPB_INLINE grpc_gcp_ServerHandshakeParameters* grpc_gcp_ServerHandshakeParameter return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_ServerHandshakeParameters_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void grpc_gcp_ServerHandshakeParameters_clear_record_protocols(const grpc_gcp_ServerHandshakeParameters* msg) { _upb_array_detach(msg, UPB_SIZE(0, 0)); @@ -533,11 +549,15 @@ UPB_INLINE grpc_gcp_StartServerHandshakeReq* grpc_gcp_StartServerHandshakeReq_pa 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_StartServerHandshakeReq_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void grpc_gcp_StartServerHandshakeReq_clear_application_protocols(const grpc_gcp_StartServerHandshakeReq* msg) { _upb_array_detach(msg, UPB_SIZE(8, 8)); @@ -710,11 +730,15 @@ UPB_INLINE grpc_gcp_NextHandshakeMessageReq* grpc_gcp_NextHandshakeMessageReq_pa return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_NextHandshakeMessageReq_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -752,11 +776,15 @@ UPB_INLINE grpc_gcp_HandshakerReq* grpc_gcp_HandshakerReq_parse_ex(const char* b return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerReq_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerReq_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { grpc_gcp_HandshakerReq_req_oneof_client_start = 1, @@ -857,11 +885,15 @@ UPB_INLINE grpc_gcp_HandshakerResult* grpc_gcp_HandshakerResult_parse_ex(const c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerResult_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerResult_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -1001,11 +1033,15 @@ UPB_INLINE grpc_gcp_HandshakerStatus* grpc_gcp_HandshakerStatus_parse_ex(const c return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerStatus_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerStatus_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void grpc_gcp_HandshakerStatus_clear_code(const grpc_gcp_HandshakerStatus* msg) { *UPB_PTR_AT(msg, UPB_SIZE(0, 0), uint32_t) = 0; @@ -1052,11 +1088,15 @@ UPB_INLINE grpc_gcp_HandshakerResp* grpc_gcp_HandshakerResp_parse_ex(const char* return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerResp_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_HandshakerResp_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c index 1f9b52e4230..c87e955c2da 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.c @@ -25,7 +25,7 @@ static const upb_MiniTable_Field grpc_gcp_RpcProtocolVersions__fields[2] = { const upb_MiniTable grpc_gcp_RpcProtocolVersions_msginit = { &grpc_gcp_RpcProtocolVersions_submsgs[0], &grpc_gcp_RpcProtocolVersions__fields[0], - UPB_SIZE(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field grpc_gcp_RpcProtocolVersions_Version__fields[2] = { diff --git a/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h index 6699d531fb0..b60c9402672 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/gcp/transport_security_common.upb.h @@ -60,11 +60,15 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions* grpc_gcp_RpcProtocolVersions_parse_ex(c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool grpc_gcp_RpcProtocolVersions_has_max_rpc_version(const grpc_gcp_RpcProtocolVersions* msg) { return _upb_hasbit(msg, 1); @@ -137,11 +141,15 @@ UPB_INLINE grpc_gcp_RpcProtocolVersions_Version* grpc_gcp_RpcProtocolVersions_Ve 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_gcp_RpcProtocolVersions_Version_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c index 6869668ef41..76ea0a50080 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.c @@ -19,7 +19,7 @@ static const upb_MiniTable_Field grpc_health_v1_HealthCheckRequest__fields[1] = const upb_MiniTable grpc_health_v1_HealthCheckRequest_msginit = { NULL, &grpc_health_v1_HealthCheckRequest__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field grpc_health_v1_HealthCheckResponse__fields[1] = { @@ -29,7 +29,7 @@ static const upb_MiniTable_Field grpc_health_v1_HealthCheckResponse__fields[1] = const upb_MiniTable grpc_health_v1_HealthCheckResponse_msginit = { NULL, &grpc_health_v1_HealthCheckResponse__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h index cff014e4796..74f2df4458b 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/health/v1/health.upb.h @@ -61,11 +61,15 @@ UPB_INLINE grpc_health_v1_HealthCheckRequest* grpc_health_v1_HealthCheckRequest_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckRequest_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -103,11 +107,15 @@ UPB_INLINE grpc_health_v1_HealthCheckResponse* grpc_health_v1_HealthCheckRespons 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_health_v1_HealthCheckResponse_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c index bb7a9361a0a..591afb886e2 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field grpc_lb_v1_LoadBalanceRequest__fields[2] = { const upb_MiniTable grpc_lb_v1_LoadBalanceRequest_msginit = { &grpc_lb_v1_LoadBalanceRequest_submsgs[0], &grpc_lb_v1_LoadBalanceRequest__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceRequest__fields[1] = { @@ -37,7 +37,7 @@ static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceRequest__fields[1] const upb_MiniTable grpc_lb_v1_InitialLoadBalanceRequest_msginit = { NULL, &grpc_lb_v1_InitialLoadBalanceRequest__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field grpc_lb_v1_ClientStatsPerToken__fields[2] = { @@ -86,13 +86,13 @@ static const upb_MiniTable_Field grpc_lb_v1_LoadBalanceResponse__fields[3] = { const upb_MiniTable grpc_lb_v1_LoadBalanceResponse_msginit = { &grpc_lb_v1_LoadBalanceResponse_submsgs[0], &grpc_lb_v1_LoadBalanceResponse__fields[0], - UPB_SIZE(8, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(8, 16), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub grpc_lb_v1_InitialLoadBalanceResponse_submsgs[1] = { @@ -106,7 +106,7 @@ static const upb_MiniTable_Field grpc_lb_v1_InitialLoadBalanceResponse__fields[1 const upb_MiniTable grpc_lb_v1_InitialLoadBalanceResponse_msginit = { &grpc_lb_v1_InitialLoadBalanceResponse_submsgs[0], &grpc_lb_v1_InitialLoadBalanceResponse__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Sub grpc_lb_v1_ServerList_submsgs[1] = { @@ -120,7 +120,7 @@ static const upb_MiniTable_Field grpc_lb_v1_ServerList__fields[1] = { const upb_MiniTable grpc_lb_v1_ServerList_msginit = { &grpc_lb_v1_ServerList_submsgs[0], &grpc_lb_v1_ServerList__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field grpc_lb_v1_Server__fields[4] = { diff --git a/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h index 9209dc563e6..01420dfb808 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/lb/v1/load_balancer.upb.h @@ -79,11 +79,15 @@ UPB_INLINE grpc_lb_v1_LoadBalanceRequest* grpc_lb_v1_LoadBalanceRequest_parse_ex return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceRequest_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { grpc_lb_v1_LoadBalanceRequest_load_balance_request_type_initial_request = 1, @@ -162,11 +166,15 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceRequest* grpc_lb_v1_InitialLoadBalanceRe return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceRequest_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -204,11 +212,15 @@ UPB_INLINE grpc_lb_v1_ClientStatsPerToken* grpc_lb_v1_ClientStatsPerToken_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_ClientStatsPerToken_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -255,11 +267,15 @@ UPB_INLINE grpc_lb_v1_ClientStats* grpc_lb_v1_ClientStats_parse_ex(const char* b return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_ClientStats_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_ClientStats_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool grpc_lb_v1_ClientStats_has_timestamp(const grpc_lb_v1_ClientStats* msg) { return _upb_hasbit(msg, 1); @@ -367,11 +383,15 @@ UPB_INLINE grpc_lb_v1_LoadBalanceResponse* grpc_lb_v1_LoadBalanceResponse_parse_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_LoadBalanceResponse_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { grpc_lb_v1_LoadBalanceResponse_load_balance_response_type_initial_response = 1, @@ -472,11 +492,15 @@ UPB_INLINE grpc_lb_v1_FallbackResponse* grpc_lb_v1_FallbackResponse_parse_ex(con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_FallbackResponse_msginit, options, arena, &ptr, len); + return ptr; } @@ -505,11 +529,15 @@ UPB_INLINE grpc_lb_v1_InitialLoadBalanceResponse* grpc_lb_v1_InitialLoadBalanceR 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_InitialLoadBalanceResponse_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool grpc_lb_v1_InitialLoadBalanceResponse_has_client_stats_report_interval(const grpc_lb_v1_InitialLoadBalanceResponse* msg) { return _upb_hasbit(msg, 1); @@ -560,11 +588,15 @@ UPB_INLINE grpc_lb_v1_ServerList* grpc_lb_v1_ServerList_parse_ex(const char* buf return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_ServerList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_ServerList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -614,11 +646,15 @@ UPB_INLINE grpc_lb_v1_Server* grpc_lb_v1_Server_parse_ex(const char* buf, size_t return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_Server_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lb_v1_Server_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c index 74baa3e9909..bf835ed6a3e 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupRequest__fields[4] = 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, + UPB_SIZE(24, 48), 4, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupRequest_KeyMapEntry__fields[2] = { @@ -48,7 +48,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupResponse__fields[2] = 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h index 09700e5d8b9..81d7a017ad1 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls.upb.h @@ -63,11 +63,15 @@ UPB_INLINE grpc_lookup_v1_RouteLookupRequest* grpc_lookup_v1_RouteLookupRequest_ 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupRequest_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -165,11 +169,15 @@ UPB_INLINE grpc_lookup_v1_RouteLookupResponse* grpc_lookup_v1_RouteLookupRespons 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupResponse_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c index 32cfcff331d..161f0102a0b 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c +++ b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_NameMatcher__fields[3] = { 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, + UPB_SIZE(16, 32), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub grpc_lookup_v1_GrpcKeyBuilder_submsgs[4] = { @@ -42,7 +42,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder__fields[4] = { 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, + UPB_SIZE(24, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_Name__fields[2] = { @@ -53,7 +53,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_Name__fields[2] = 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields[3] = { @@ -65,7 +65,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys__fields 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, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Field grpc_lookup_v1_GrpcKeyBuilder_ConstantKeysEntry__fields[2] = { @@ -96,7 +96,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_HttpKeyBuilder__fields[5] = { 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, + UPB_SIZE(24, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Field grpc_lookup_v1_HttpKeyBuilder_ConstantKeysEntry__fields[2] = { @@ -133,7 +133,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupConfig__fields[9] = { 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, + UPB_SIZE(56, 96), 9, kUpb_ExtMode_NonExtendable, 9, 255, 0, }; static const upb_MiniTable_Sub grpc_lookup_v1_RouteLookupClusterSpecifier_submsgs[1] = { @@ -147,7 +147,7 @@ static const upb_MiniTable_Field grpc_lookup_v1_RouteLookupClusterSpecifier__fie 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[9] = { diff --git a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h index e84e3144882..bbb5cd85a7f 100644 --- a/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h +++ b/src/core/ext/upb-generated/src/proto/grpc/lookup/v1/rls_config.upb.h @@ -77,11 +77,15 @@ UPB_INLINE grpc_lookup_v1_NameMatcher* grpc_lookup_v1_NameMatcher_parse_ex(const 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_NameMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -143,11 +147,15 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder* grpc_lookup_v1_GrpcKeyBuilder_parse_ex 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -265,11 +273,15 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_Name* grpc_lookup_v1_GrpcKeyBuilder_Nam 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_Name_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -316,11 +328,15 @@ UPB_INLINE grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys* grpc_lookup_v1_GrpcKeyBuilde 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_GrpcKeyBuilder_ExtraKeys_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -393,11 +409,15 @@ UPB_INLINE grpc_lookup_v1_HttpKeyBuilder* grpc_lookup_v1_HttpKeyBuilder_parse_ex 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_HttpKeyBuilder_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE void grpc_lookup_v1_HttpKeyBuilder_clear_host_patterns(const grpc_lookup_v1_HttpKeyBuilder* msg) { _upb_array_detach(msg, UPB_SIZE(0, 0)); @@ -540,11 +560,15 @@ UPB_INLINE grpc_lookup_v1_RouteLookupConfig* grpc_lookup_v1_RouteLookupConfig_pa 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupConfig_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -723,11 +747,15 @@ UPB_INLINE grpc_lookup_v1_RouteLookupClusterSpecifier* grpc_lookup_v1_RouteLooku 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &grpc_lookup_v1_RouteLookupClusterSpecifier_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool grpc_lookup_v1_RouteLookupClusterSpecifier_has_route_lookup_config(const grpc_lookup_v1_RouteLookupClusterSpecifier* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c b/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c index 37433b60783..85a0578e034 100644 --- a/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/migrate.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field udpa_annotations_MigrateAnnotation__fields[1] = const upb_MiniTable udpa_annotations_MigrateAnnotation_msginit = { NULL, &udpa_annotations_MigrateAnnotation__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field udpa_annotations_FieldMigrateAnnotation__fields[2] = { @@ -31,7 +31,7 @@ static const upb_MiniTable_Field udpa_annotations_FieldMigrateAnnotation__fields const upb_MiniTable udpa_annotations_FieldMigrateAnnotation_msginit = { NULL, &udpa_annotations_FieldMigrateAnnotation__fields[0], - UPB_SIZE(16, 40), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field udpa_annotations_FileMigrateAnnotation__fields[1] = { @@ -41,7 +41,7 @@ static const upb_MiniTable_Field udpa_annotations_FileMigrateAnnotation__fields[ const upb_MiniTable udpa_annotations_FileMigrateAnnotation_msginit = { NULL, &udpa_annotations_FileMigrateAnnotation__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h b/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h index bf07294af7e..1aa1bdbffe6 100644 --- a/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/migrate.upb.h @@ -72,11 +72,15 @@ UPB_INLINE udpa_annotations_MigrateAnnotation* udpa_annotations_MigrateAnnotatio 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_MigrateAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -114,11 +118,15 @@ UPB_INLINE udpa_annotations_FieldMigrateAnnotation* udpa_annotations_FieldMigrat 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_FieldMigrateAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -165,11 +173,15 @@ UPB_INLINE udpa_annotations_FileMigrateAnnotation* udpa_annotations_FileMigrateA return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_FileMigrateAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -195,7 +207,7 @@ UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_message_mi } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_message_migrate_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext; } @@ -212,7 +224,7 @@ UPB_INLINE const udpa_annotations_FieldMigrateAnnotation* udpa_annotations_field } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_field_migrate_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FieldMigrateAnnotation*) = ext; } @@ -229,7 +241,7 @@ UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_migra } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_enum_migrate_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext; } @@ -246,7 +258,7 @@ UPB_INLINE const udpa_annotations_MigrateAnnotation* udpa_annotations_enum_value } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_enum_value_migrate_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_MigrateAnnotation*) = ext; } @@ -263,7 +275,7 @@ UPB_INLINE const udpa_annotations_FileMigrateAnnotation* udpa_annotations_file_m } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_file_migrate_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FileMigrateAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/udpa/annotations/security.upb.c b/src/core/ext/upb-generated/udpa/annotations/security.upb.c index e5b92547aea..c8065152134 100644 --- a/src/core/ext/upb-generated/udpa/annotations/security.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/security.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field udpa_annotations_FieldSecurityAnnotation__field const upb_MiniTable udpa_annotations_FieldSecurityAnnotation_msginit = { NULL, &udpa_annotations_FieldSecurityAnnotation__fields[0], - UPB_SIZE(2, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/udpa/annotations/security.upb.h b/src/core/ext/upb-generated/udpa/annotations/security.upb.h index 67cbd426f41..9ada3c0a7a6 100644 --- a/src/core/ext/upb-generated/udpa/annotations/security.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/security.upb.h @@ -54,11 +54,15 @@ UPB_INLINE udpa_annotations_FieldSecurityAnnotation* udpa_annotations_FieldSecur 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_FieldSecurityAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -93,7 +97,7 @@ UPB_INLINE const udpa_annotations_FieldSecurityAnnotation* udpa_annotations_secu } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_security_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_FieldSecurityAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/udpa/annotations/status.upb.h b/src/core/ext/upb-generated/udpa/annotations/status.upb.h index 97fe972db06..8e4eeed1928 100644 --- a/src/core/ext/upb-generated/udpa/annotations/status.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/status.upb.h @@ -61,11 +61,15 @@ UPB_INLINE udpa_annotations_StatusAnnotation* udpa_annotations_StatusAnnotation_ 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_StatusAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_StatusAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -100,7 +104,7 @@ UPB_INLINE const udpa_annotations_StatusAnnotation* udpa_annotations_file_status } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_file_status_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_StatusAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c b/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c index ff259714b45..a0db4c09806 100644 --- a/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c +++ b/src/core/ext/upb-generated/udpa/annotations/versioning.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field udpa_annotations_VersioningAnnotation__fields[1 const upb_MiniTable udpa_annotations_VersioningAnnotation_msginit = { NULL, &udpa_annotations_VersioningAnnotation__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h b/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h index 4762bda2a45..ad96fcd758c 100644 --- a/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h +++ b/src/core/ext/upb-generated/udpa/annotations/versioning.upb.h @@ -54,11 +54,15 @@ UPB_INLINE udpa_annotations_VersioningAnnotation* udpa_annotations_VersioningAnn 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &udpa_annotations_VersioningAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -84,7 +88,7 @@ UPB_INLINE const udpa_annotations_VersioningAnnotation* udpa_annotations_version } 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_Message_GetOrCreateExtension(msg, &udpa_annotations_versioning_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const udpa_annotations_VersioningAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/validate/validate.upb.c b/src/core/ext/upb-generated/validate/validate.upb.c index a41a2f751bc..9dc0a42392f 100644 --- a/src/core/ext/upb-generated/validate/validate.upb.c +++ b/src/core/ext/upb-generated/validate/validate.upb.c @@ -85,7 +85,7 @@ static const upb_MiniTable_Field validate_FloatRules__fields[8] = { const upb_MiniTable validate_FloatRules_msginit = { NULL, &validate_FloatRules__fields[0], - UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_DoubleRules__fields[8] = { @@ -102,7 +102,7 @@ static const upb_MiniTable_Field validate_DoubleRules__fields[8] = { const upb_MiniTable validate_DoubleRules_msginit = { NULL, &validate_DoubleRules__fields[0], - UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_Int32Rules__fields[8] = { @@ -119,7 +119,7 @@ static const upb_MiniTable_Field validate_Int32Rules__fields[8] = { const upb_MiniTable validate_Int32Rules_msginit = { NULL, &validate_Int32Rules__fields[0], - UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_Int64Rules__fields[8] = { @@ -136,7 +136,7 @@ static const upb_MiniTable_Field validate_Int64Rules__fields[8] = { const upb_MiniTable validate_Int64Rules_msginit = { NULL, &validate_Int64Rules__fields[0], - UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_UInt32Rules__fields[8] = { @@ -153,7 +153,7 @@ static const upb_MiniTable_Field validate_UInt32Rules__fields[8] = { const upb_MiniTable validate_UInt32Rules_msginit = { NULL, &validate_UInt32Rules__fields[0], - UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_UInt64Rules__fields[8] = { @@ -170,7 +170,7 @@ static const upb_MiniTable_Field validate_UInt64Rules__fields[8] = { const upb_MiniTable validate_UInt64Rules_msginit = { NULL, &validate_UInt64Rules__fields[0], - UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_SInt32Rules__fields[8] = { @@ -187,7 +187,7 @@ static const upb_MiniTable_Field validate_SInt32Rules__fields[8] = { const upb_MiniTable validate_SInt32Rules_msginit = { NULL, &validate_SInt32Rules__fields[0], - UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_SInt64Rules__fields[8] = { @@ -204,7 +204,7 @@ static const upb_MiniTable_Field validate_SInt64Rules__fields[8] = { const upb_MiniTable validate_SInt64Rules_msginit = { NULL, &validate_SInt64Rules__fields[0], - UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_Fixed32Rules__fields[8] = { @@ -221,7 +221,7 @@ static const upb_MiniTable_Field validate_Fixed32Rules__fields[8] = { const upb_MiniTable validate_Fixed32Rules_msginit = { NULL, &validate_Fixed32Rules__fields[0], - UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_Fixed64Rules__fields[8] = { @@ -238,7 +238,7 @@ static const upb_MiniTable_Field validate_Fixed64Rules__fields[8] = { const upb_MiniTable validate_Fixed64Rules_msginit = { NULL, &validate_Fixed64Rules__fields[0], - UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_SFixed32Rules__fields[8] = { @@ -255,7 +255,7 @@ static const upb_MiniTable_Field validate_SFixed32Rules__fields[8] = { const upb_MiniTable validate_SFixed32Rules_msginit = { NULL, &validate_SFixed32Rules__fields[0], - UPB_SIZE(36, 56), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(40, 48), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_SFixed64Rules__fields[8] = { @@ -272,7 +272,7 @@ static const upb_MiniTable_Field validate_SFixed64Rules__fields[8] = { const upb_MiniTable validate_SFixed64Rules_msginit = { NULL, &validate_SFixed64Rules__fields[0], - UPB_SIZE(56, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(56, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Field validate_BoolRules__fields[1] = { @@ -282,7 +282,7 @@ static const upb_MiniTable_Field validate_BoolRules__fields[1] = { const upb_MiniTable validate_BoolRules_msginit = { NULL, &validate_BoolRules__fields[0], - UPB_SIZE(2, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub validate_StringRules_submsgs[1] = { @@ -321,7 +321,7 @@ static const upb_MiniTable_Field validate_StringRules__fields[26] = { const upb_MiniTable validate_StringRules_msginit = { &validate_StringRules_submsgs[0], &validate_StringRules__fields[0], - UPB_SIZE(120, 184), 26, kUpb_ExtMode_NonExtendable, 26, 255, 0, + UPB_SIZE(120, 176), 26, kUpb_ExtMode_NonExtendable, 26, 255, 0, }; static const upb_MiniTable_Field validate_BytesRules__fields[14] = { @@ -357,7 +357,7 @@ static const upb_MiniTable_Field validate_EnumRules__fields[4] = { const upb_MiniTable validate_EnumRules_msginit = { NULL, &validate_EnumRules__fields[0], - UPB_SIZE(20, 40), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(24, 32), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Field validate_MessageRules__fields[2] = { @@ -368,7 +368,7 @@ static const upb_MiniTable_Field validate_MessageRules__fields[2] = { const upb_MiniTable validate_MessageRules_msginit = { NULL, &validate_MessageRules__fields[0], - UPB_SIZE(3, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub validate_RepeatedRules_submsgs[1] = { @@ -386,7 +386,7 @@ static const upb_MiniTable_Field validate_RepeatedRules__fields[5] = { const upb_MiniTable validate_RepeatedRules_msginit = { &validate_RepeatedRules_submsgs[0], &validate_RepeatedRules__fields[0], - UPB_SIZE(24, 40), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, + UPB_SIZE(24, 32), 5, kUpb_ExtMode_NonExtendable, 5, 255, 0, }; static const upb_MiniTable_Sub validate_MapRules_submsgs[2] = { @@ -418,7 +418,7 @@ static const upb_MiniTable_Field validate_AnyRules__fields[3] = { const upb_MiniTable validate_AnyRules_msginit = { NULL, &validate_AnyRules__fields[0], - UPB_SIZE(12, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(16, 24), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable_Sub validate_DurationRules_submsgs[7] = { @@ -445,7 +445,7 @@ static const upb_MiniTable_Field validate_DurationRules__fields[8] = { const upb_MiniTable validate_DurationRules_msginit = { &validate_DurationRules_submsgs[0], &validate_DurationRules__fields[0], - UPB_SIZE(32, 72), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, + UPB_SIZE(32, 64), 8, kUpb_ExtMode_NonExtendable, 8, 255, 0, }; static const upb_MiniTable_Sub validate_TimestampRules_submsgs[6] = { @@ -538,9 +538,9 @@ static const upb_MiniTable_Extension *extensions_layout[4] = { }; const upb_MiniTable_Enum validate_KnownRegex_enuminit = { - NULL, - 0x7ULL, - 0, + NULL, + 0x7ULL, + 0, }; static const upb_MiniTable_Enum *enums_layout[1] = { diff --git a/src/core/ext/upb-generated/validate/validate.upb.h b/src/core/ext/upb-generated/validate/validate.upb.h index 6276dee4ebb..b78ce98bcc9 100644 --- a/src/core/ext/upb-generated/validate/validate.upb.h +++ b/src/core/ext/upb-generated/validate/validate.upb.h @@ -138,11 +138,15 @@ UPB_INLINE validate_FieldRules* validate_FieldRules_parse_ex(const char* buf, si return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_FieldRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_FieldRules_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { validate_FieldRules_type_float = 1, @@ -661,11 +665,15 @@ UPB_INLINE validate_FloatRules* validate_FloatRules_parse_ex(const char* buf, si 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); + char* ptr; + (void)upb_Encode(msg, &validate_FloatRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_FloatRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_FloatRules_has_const(const validate_FloatRules* msg) { return _upb_hasbit(msg, 1); @@ -808,11 +816,15 @@ UPB_INLINE validate_DoubleRules* validate_DoubleRules_parse_ex(const char* buf, 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); + char* ptr; + (void)upb_Encode(msg, &validate_DoubleRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_DoubleRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_DoubleRules_has_const(const validate_DoubleRules* msg) { return _upb_hasbit(msg, 1); @@ -955,11 +967,15 @@ UPB_INLINE validate_Int32Rules* validate_Int32Rules_parse_ex(const char* buf, si 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); + char* ptr; + (void)upb_Encode(msg, &validate_Int32Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_Int32Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_Int32Rules_has_const(const validate_Int32Rules* msg) { return _upb_hasbit(msg, 1); @@ -1102,11 +1118,15 @@ UPB_INLINE validate_Int64Rules* validate_Int64Rules_parse_ex(const char* buf, si 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); + char* ptr; + (void)upb_Encode(msg, &validate_Int64Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_Int64Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_Int64Rules_has_const(const validate_Int64Rules* msg) { return _upb_hasbit(msg, 1); @@ -1249,11 +1269,15 @@ UPB_INLINE validate_UInt32Rules* validate_UInt32Rules_parse_ex(const char* buf, 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); + char* ptr; + (void)upb_Encode(msg, &validate_UInt32Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_UInt32Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_UInt32Rules_has_const(const validate_UInt32Rules* msg) { return _upb_hasbit(msg, 1); @@ -1396,11 +1420,15 @@ UPB_INLINE validate_UInt64Rules* validate_UInt64Rules_parse_ex(const char* buf, 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); + char* ptr; + (void)upb_Encode(msg, &validate_UInt64Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_UInt64Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_UInt64Rules_has_const(const validate_UInt64Rules* msg) { return _upb_hasbit(msg, 1); @@ -1543,11 +1571,15 @@ UPB_INLINE validate_SInt32Rules* validate_SInt32Rules_parse_ex(const char* buf, 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); + char* ptr; + (void)upb_Encode(msg, &validate_SInt32Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_SInt32Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_SInt32Rules_has_const(const validate_SInt32Rules* msg) { return _upb_hasbit(msg, 1); @@ -1690,11 +1722,15 @@ UPB_INLINE validate_SInt64Rules* validate_SInt64Rules_parse_ex(const char* buf, 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); + char* ptr; + (void)upb_Encode(msg, &validate_SInt64Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_SInt64Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_SInt64Rules_has_const(const validate_SInt64Rules* msg) { return _upb_hasbit(msg, 1); @@ -1837,11 +1873,15 @@ UPB_INLINE validate_Fixed32Rules* validate_Fixed32Rules_parse_ex(const char* buf 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); + char* ptr; + (void)upb_Encode(msg, &validate_Fixed32Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_Fixed32Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_Fixed32Rules_has_const(const validate_Fixed32Rules* msg) { return _upb_hasbit(msg, 1); @@ -1984,11 +2024,15 @@ UPB_INLINE validate_Fixed64Rules* validate_Fixed64Rules_parse_ex(const char* buf 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); + char* ptr; + (void)upb_Encode(msg, &validate_Fixed64Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_Fixed64Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_Fixed64Rules_has_const(const validate_Fixed64Rules* msg) { return _upb_hasbit(msg, 1); @@ -2131,11 +2175,15 @@ UPB_INLINE validate_SFixed32Rules* validate_SFixed32Rules_parse_ex(const char* b 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); + char* ptr; + (void)upb_Encode(msg, &validate_SFixed32Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_SFixed32Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_SFixed32Rules_has_const(const validate_SFixed32Rules* msg) { return _upb_hasbit(msg, 1); @@ -2278,11 +2326,15 @@ UPB_INLINE validate_SFixed64Rules* validate_SFixed64Rules_parse_ex(const char* b 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); + char* ptr; + (void)upb_Encode(msg, &validate_SFixed64Rules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_SFixed64Rules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_SFixed64Rules_has_const(const validate_SFixed64Rules* msg) { return _upb_hasbit(msg, 1); @@ -2425,11 +2477,15 @@ UPB_INLINE validate_BoolRules* validate_BoolRules_parse_ex(const char* buf, size return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_BoolRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_BoolRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_BoolRules_has_const(const validate_BoolRules* msg) { return _upb_hasbit(msg, 1); @@ -2472,11 +2528,15 @@ UPB_INLINE validate_StringRules* validate_StringRules_parse_ex(const char* buf, return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_StringRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_StringRules_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { validate_StringRules_well_known_email = 12, @@ -2867,11 +2927,15 @@ UPB_INLINE validate_BytesRules* validate_BytesRules_parse_ex(const char* buf, si return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_BytesRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_BytesRules_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { validate_BytesRules_well_known_ip = 10, @@ -3101,11 +3165,15 @@ UPB_INLINE validate_EnumRules* validate_EnumRules_parse_ex(const char* buf, size return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_EnumRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_EnumRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_EnumRules_has_const(const validate_EnumRules* msg) { return _upb_hasbit(msg, 1); @@ -3192,11 +3260,15 @@ UPB_INLINE validate_MessageRules* validate_MessageRules_parse_ex(const char* buf return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_MessageRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_MessageRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_MessageRules_has_skip(const validate_MessageRules* msg) { return _upb_hasbit(msg, 1); @@ -3253,11 +3325,15 @@ UPB_INLINE validate_RepeatedRules* validate_RepeatedRules_parse_ex(const char* b return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_RepeatedRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_RepeatedRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_RepeatedRules_has_min_items(const validate_RepeatedRules* msg) { return _upb_hasbit(msg, 1); @@ -3364,11 +3440,15 @@ UPB_INLINE validate_MapRules* validate_MapRules_parse_ex(const char* buf, size_t return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_MapRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_MapRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_MapRules_has_min_pairs(const validate_MapRules* msg) { return _upb_hasbit(msg, 1); @@ -3497,11 +3577,15 @@ UPB_INLINE validate_AnyRules* validate_AnyRules_parse_ex(const char* buf, size_t return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_AnyRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_AnyRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_AnyRules_has_required(const validate_AnyRules* msg) { return _upb_hasbit(msg, 1); @@ -3574,11 +3658,15 @@ UPB_INLINE validate_DurationRules* validate_DurationRules_parse_ex(const char* b 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); + char* ptr; + (void)upb_Encode(msg, &validate_DurationRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_DurationRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_DurationRules_has_required(const validate_DurationRules* msg) { return _upb_hasbit(msg, 1); @@ -3773,11 +3861,15 @@ UPB_INLINE validate_TimestampRules* validate_TimestampRules_parse_ex(const char* 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); + char* ptr; + (void)upb_Encode(msg, &validate_TimestampRules_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &validate_TimestampRules_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool validate_TimestampRules_has_required(const validate_TimestampRules* msg) { return _upb_hasbit(msg, 1); @@ -3998,7 +4090,7 @@ UPB_INLINE const validate_FieldRules* validate_rules(const struct google_protobu } 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_Message_GetOrCreateExtension(msg, &validate_rules_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const validate_FieldRules*) = ext; } diff --git a/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c b/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c index cbd41bf3903..cdc3dcf3c64 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c +++ b/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field xds_annotations_v3_MigrateAnnotation__fields[1] 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field xds_annotations_v3_FieldMigrateAnnotation__fields[2] = { @@ -31,7 +31,7 @@ static const upb_MiniTable_Field xds_annotations_v3_FieldMigrateAnnotation__fiel 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Field xds_annotations_v3_FileMigrateAnnotation__fields[1] = { @@ -41,7 +41,7 @@ static const upb_MiniTable_Field xds_annotations_v3_FileMigrateAnnotation__field 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[3] = { diff --git a/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h b/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h index b419b075a19..0ad7b304ad3 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h +++ b/src/core/ext/upb-generated/xds/annotations/v3/migrate.upb.h @@ -72,11 +72,15 @@ UPB_INLINE xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_MigrateAnnot 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_MigrateAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -114,11 +118,15 @@ UPB_INLINE xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_FieldMi 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FieldMigrateAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -165,11 +173,15 @@ UPB_INLINE xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_FileMigr 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FileMigrateAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -195,7 +207,7 @@ UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_messag } 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_Message_GetOrCreateExtension(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; } @@ -212,7 +224,7 @@ UPB_INLINE const xds_annotations_v3_FieldMigrateAnnotation* xds_annotations_v3_f } 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_Message_GetOrCreateExtension(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; } @@ -229,7 +241,7 @@ UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_enum_m } 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_Message_GetOrCreateExtension(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; } @@ -246,7 +258,7 @@ UPB_INLINE const xds_annotations_v3_MigrateAnnotation* xds_annotations_v3_enum_v } 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_Message_GetOrCreateExtension(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; } @@ -263,7 +275,7 @@ UPB_INLINE const xds_annotations_v3_FileMigrateAnnotation* xds_annotations_v3_fi } 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_Message_GetOrCreateExtension(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; } diff --git a/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c b/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c index 2fb3e9109a1..3ffb371b3d2 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c +++ b/src/core/ext/upb-generated/xds/annotations/v3/security.upb.c @@ -22,7 +22,7 @@ static const upb_MiniTable_Field xds_annotations_v3_FieldSecurityAnnotation__fie 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, + UPB_SIZE(8, 8), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h b/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h index 1da6a1ae835..80046ff5cc8 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h +++ b/src/core/ext/upb-generated/xds/annotations/v3/security.upb.h @@ -54,11 +54,15 @@ UPB_INLINE xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_FieldS 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FieldSecurityAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -93,7 +97,7 @@ UPB_INLINE const xds_annotations_v3_FieldSecurityAnnotation* xds_annotations_v3_ } 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_Message_GetOrCreateExtension(msg, &xds_annotations_v3_security_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_FieldSecurityAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c b/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c index 56aa30db58d..fea67a994c0 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c +++ b/src/core/ext/upb-generated/xds/annotations/v3/status.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field xds_annotations_v3_FileStatusAnnotation__fields 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field xds_annotations_v3_MessageStatusAnnotation__fields[1] = { @@ -30,7 +30,7 @@ static const upb_MiniTable_Field xds_annotations_v3_MessageStatusAnnotation__fie 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field xds_annotations_v3_FieldStatusAnnotation__fields[1] = { @@ -40,7 +40,7 @@ static const upb_MiniTable_Field xds_annotations_v3_FieldStatusAnnotation__field 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field xds_annotations_v3_StatusAnnotation__fields[2] = { diff --git a/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h b/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h index dc5c2cb5098..42d2584e936 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h +++ b/src/core/ext/upb-generated/xds/annotations/v3/status.upb.h @@ -76,11 +76,15 @@ UPB_INLINE xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_FileStatu 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FileStatusAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -118,11 +122,15 @@ UPB_INLINE xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_Messag 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_MessageStatusAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -160,11 +168,15 @@ UPB_INLINE xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_FieldSta 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_FieldStatusAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -202,11 +214,15 @@ UPB_INLINE xds_annotations_v3_StatusAnnotation* xds_annotations_v3_StatusAnnotat 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_StatusAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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; @@ -241,7 +257,7 @@ UPB_INLINE const xds_annotations_v3_FileStatusAnnotation* xds_annotations_v3_fil } 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_Message_GetOrCreateExtension(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; } @@ -258,7 +274,7 @@ UPB_INLINE const xds_annotations_v3_MessageStatusAnnotation* xds_annotations_v3_ } 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_Message_GetOrCreateExtension(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; } @@ -275,7 +291,7 @@ UPB_INLINE const xds_annotations_v3_FieldStatusAnnotation* xds_annotations_v3_fi } 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_Message_GetOrCreateExtension(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; } diff --git a/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c b/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c index d3534604524..d347b400a35 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c +++ b/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.c @@ -20,7 +20,7 @@ static const upb_MiniTable_Field xds_annotations_v3_VersioningAnnotation__fields 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, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h b/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h index 20eff571472..b8d1c25b510 100644 --- a/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h +++ b/src/core/ext/upb-generated/xds/annotations/v3/versioning.upb.h @@ -54,11 +54,15 @@ UPB_INLINE xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_Versionin 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_annotations_v3_VersioningAnnotation_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -84,7 +88,7 @@ UPB_INLINE const xds_annotations_v3_VersioningAnnotation* xds_annotations_v3_ver } 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_Message_GetOrCreateExtension(msg, &xds_annotations_v3_versioning_ext, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, const xds_annotations_v3_VersioningAnnotation*) = ext; } diff --git a/src/core/ext/upb-generated/xds/core/v3/authority.upb.c b/src/core/ext/upb-generated/xds/core/v3/authority.upb.c index edadf4206e5..9b028c0b67d 100644 --- a/src/core/ext/upb-generated/xds/core/v3/authority.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/authority.upb.c @@ -21,7 +21,7 @@ static const upb_MiniTable_Field xds_core_v3_Authority__fields[1] = { const upb_MiniTable xds_core_v3_Authority_msginit = { NULL, &xds_core_v3_Authority__fields[0], - UPB_SIZE(8, 24), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 16), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/authority.upb.h b/src/core/ext/upb-generated/xds/core/v3/authority.upb.h index 8f7c8bd5588..fb13422e2ea 100644 --- a/src/core/ext/upb-generated/xds/core/v3/authority.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/authority.upb.h @@ -51,11 +51,15 @@ UPB_INLINE xds_core_v3_Authority* xds_core_v3_Authority_parse_ex(const char* buf 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_Authority_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_Authority_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c b/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c index c3b012c6459..8d7f42ff348 100644 --- a/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field xds_core_v3_CollectionEntry__fields[2] = { const upb_MiniTable xds_core_v3_CollectionEntry_msginit = { &xds_core_v3_CollectionEntry_submsgs[0], &xds_core_v3_CollectionEntry__fields[0], - UPB_SIZE(8, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub xds_core_v3_CollectionEntry_InlineEntry_submsgs[1] = { @@ -45,7 +45,7 @@ static const upb_MiniTable_Field xds_core_v3_CollectionEntry_InlineEntry__fields 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, 56), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 48), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h b/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h index 249ee2e7588..11826a18ec9 100644 --- a/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/collection_entry.upb.h @@ -58,11 +58,15 @@ UPB_INLINE xds_core_v3_CollectionEntry* xds_core_v3_CollectionEntry_parse_ex(con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_core_v3_CollectionEntry_resource_specifier_locator = 1, @@ -141,11 +145,15 @@ UPB_INLINE xds_core_v3_CollectionEntry_InlineEntry* xds_core_v3_CollectionEntry_ return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_CollectionEntry_InlineEntry_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c b/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c index b9acaff4a42..495138875d2 100644 --- a/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/context_params.upb.c @@ -24,7 +24,7 @@ static const upb_MiniTable_Field xds_core_v3_ContextParams__fields[1] = { const upb_MiniTable xds_core_v3_ContextParams_msginit = { &xds_core_v3_ContextParams_submsgs[0], &xds_core_v3_ContextParams__fields[0], - UPB_SIZE(4, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Field xds_core_v3_ContextParams_ParamsEntry__fields[2] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h b/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h index 89ec9d86a07..a83b9b37040 100644 --- a/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/context_params.upb.h @@ -54,11 +54,15 @@ UPB_INLINE xds_core_v3_ContextParams* xds_core_v3_ContextParams_parse_ex(const c 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ContextParams_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ContextParams_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/xds/core/v3/extension.upb.c b/src/core/ext/upb-generated/xds/core/v3/extension.upb.c index 53a02981321..550d2066ddb 100644 --- a/src/core/ext/upb-generated/xds/core/v3/extension.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/extension.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field xds_core_v3_TypedExtensionConfig__fields[2] = { 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/extension.upb.h b/src/core/ext/upb-generated/xds/core/v3/extension.upb.h index f5de22074f8..b7fb888d954 100644 --- a/src/core/ext/upb-generated/xds/core/v3/extension.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/extension.upb.h @@ -53,11 +53,15 @@ UPB_INLINE xds_core_v3_TypedExtensionConfig* xds_core_v3_TypedExtensionConfig_pa 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_TypedExtensionConfig_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/xds/core/v3/resource.upb.c b/src/core/ext/upb-generated/xds/core/v3/resource.upb.c index d3d04c66746..e91f025858f 100644 --- a/src/core/ext/upb-generated/xds/core/v3/resource.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/resource.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field xds_core_v3_Resource__fields[3] = { const upb_MiniTable xds_core_v3_Resource_msginit = { &xds_core_v3_Resource_submsgs[0], &xds_core_v3_Resource__fields[0], - UPB_SIZE(20, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, + UPB_SIZE(24, 40), 3, kUpb_ExtMode_NonExtendable, 3, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/resource.upb.h b/src/core/ext/upb-generated/xds/core/v3/resource.upb.h index 7e0df11ccf6..8dc3fad3793 100644 --- a/src/core/ext/upb-generated/xds/core/v3/resource.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/resource.upb.h @@ -55,11 +55,15 @@ UPB_INLINE xds_core_v3_Resource* xds_core_v3_Resource_parse_ex(const char* buf, 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_Resource_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_Resource_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool xds_core_v3_Resource_has_name(const xds_core_v3_Resource* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c b/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c index 5f26ef677ed..6dd053694c4 100644 --- a/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.c @@ -47,7 +47,7 @@ static const upb_MiniTable_Field xds_core_v3_ResourceLocator_Directive__fields[2 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(12, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h b/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h index 2122a000cbe..12be688fd8b 100644 --- a/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/resource_locator.upb.h @@ -62,11 +62,15 @@ UPB_INLINE xds_core_v3_ResourceLocator* xds_core_v3_ResourceLocator_parse_ex(con return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_core_v3_ResourceLocator_context_param_specifier_exact_context = 5, @@ -180,11 +184,15 @@ UPB_INLINE xds_core_v3_ResourceLocator_Directive* xds_core_v3_ResourceLocator_Di return ret; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ResourceLocator_Directive_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_core_v3_ResourceLocator_Directive_directive_alt = 1, diff --git a/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c b/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c index 5881000d0a6..c8f89b2272c 100644 --- a/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c +++ b/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.c @@ -29,7 +29,7 @@ static const upb_MiniTable_Field xds_core_v3_ResourceName__fields[4] = { const upb_MiniTable xds_core_v3_ResourceName_msginit = { &xds_core_v3_ResourceName_submsgs[0], &xds_core_v3_ResourceName__fields[0], - UPB_SIZE(32, 72), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, + UPB_SIZE(32, 64), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h b/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h index 637a6a157b3..340567cb4c2 100644 --- a/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h +++ b/src/core/ext/upb-generated/xds/core/v3/resource_name.upb.h @@ -53,11 +53,15 @@ UPB_INLINE xds_core_v3_ResourceName* xds_core_v3_ResourceName_parse_ex(const cha 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, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ResourceName_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_core_v3_ResourceName_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h b/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h index e38d6d25ff1..7ad025fe4f0 100644 --- a/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h +++ b/src/core/ext/upb-generated/xds/data/orca/v3/orca_load_report.upb.h @@ -57,11 +57,15 @@ UPB_INLINE xds_data_orca_v3_OrcaLoadReport* xds_data_orca_v3_OrcaLoadReport_pars 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); + char* ptr; + (void)upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_data_orca_v3_OrcaLoadReport_msginit, options, arena, &ptr, len); + return ptr; } 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; diff --git a/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c b/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c index cd2350ccfe9..09ff4dcd8ac 100644 --- a/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c +++ b/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.c @@ -27,7 +27,7 @@ static const upb_MiniTable_Field xds_service_orca_v3_OrcaLoadReportRequest__fiel 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h b/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h index 53f348f248e..a974b62b3c6 100644 --- a/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h +++ b/src/core/ext/upb-generated/xds/service/orca/v3/orca.upb.h @@ -53,11 +53,15 @@ UPB_INLINE xds_service_orca_v3_OrcaLoadReportRequest* xds_service_orca_v3_OrcaLo 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); + char* ptr; + (void)upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_service_orca_v3_OrcaLoadReportRequest_msginit, options, arena, &ptr, len); + return ptr; } UPB_INLINE bool xds_service_orca_v3_OrcaLoadReportRequest_has_report_interval(const xds_service_orca_v3_OrcaLoadReportRequest* msg) { return _upb_hasbit(msg, 1); diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c index 6696f4d7d64..202d77e5b3e 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.c @@ -47,7 +47,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_OnMatch__fields[2] 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, + UPB_SIZE(8, 16), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_submsgs[1] = { @@ -61,7 +61,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList__fields 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_submsgs[4] = { @@ -81,7 +81,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predica 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, + UPB_SIZE(8, 16), 4, kUpb_ExtMode_NonExtendable, 4, 255, 0, }; static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_submsgs[3] = { @@ -113,7 +113,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_Predica 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_submsgs[2] = { @@ -129,7 +129,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherList_FieldMa 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, + UPB_SIZE(16, 24), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_submsgs[4] = { @@ -163,7 +163,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_Matcher_MatcherTree_MatchMa 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable_Sub xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_MapEntry_submsgs[1] = { diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h index 9b7f673cf06..b1d36c0075f 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/matcher.upb.h @@ -82,11 +82,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher* xds_type_matcher_v3_Matcher_parse_ex(con 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_Matcher_matcher_type_matcher_list = 1, @@ -187,11 +191,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_OnMatch* xds_type_matcher_v3_Matcher_OnMa 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_OnMatch_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_Matcher_OnMatch_on_match_matcher = 1, @@ -270,11 +278,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList* xds_type_matcher_v3_Matcher_ 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -324,11 +336,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate* xds_type_matcher_v 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_Matcher_MatcherList_Predicate_match_type_single_predicate = 1, @@ -451,11 +467,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate* xd 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_Matcher_MatcherList_Predicate_SinglePredicate_matcher_value_match = 2, @@ -556,11 +576,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList* xds_ 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_Predicate_PredicateList_msginit, options, arena, &ptr, len); + return ptr; } 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)); @@ -610,11 +634,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher* xds_type_matche 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherList_FieldMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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); @@ -687,11 +715,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree* xds_type_matcher_v3_Matcher_ 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_Matcher_MatcherTree_tree_type_exact_match_map = 2, @@ -814,11 +846,15 @@ UPB_INLINE xds_type_matcher_v3_Matcher_MatcherTree_MatchMap* xds_type_matcher_v3 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_Matcher_MatcherTree_MatchMap_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c index 45a111f0cc6..b56ea5e9877 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.c @@ -25,13 +25,13 @@ static const upb_MiniTable_Field xds_type_matcher_v3_RegexMatcher__fields[2] = { 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, + UPB_SIZE(16, 32), 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, + UPB_SIZE(0, 0), 0, kUpb_ExtMode_NonExtendable, 0, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h index 77456aa3dc7..e4678598676 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/regex.upb.h @@ -54,11 +54,15 @@ UPB_INLINE xds_type_matcher_v3_RegexMatcher* xds_type_matcher_v3_RegexMatcher_pa 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_RegexMatcher_engine_type_google_re2 = 1, @@ -124,11 +128,15 @@ UPB_INLINE xds_type_matcher_v3_RegexMatcher_GoogleRE2* xds_type_matcher_v3_Regex 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_RegexMatcher_GoogleRE2_msginit, options, arena, &ptr, len); + return ptr; } diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c b/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c index 207adefc3d4..c4e683f7fb9 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.c @@ -44,7 +44,7 @@ static const upb_MiniTable_Field xds_type_matcher_v3_ListStringMatcher__fields[1 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, + UPB_SIZE(8, 8), 1, kUpb_ExtMode_NonExtendable, 1, 255, 0, }; static const upb_MiniTable *messages_layout[2] = { diff --git a/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h b/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h index 375fdcd99ff..1211783a8fd 100644 --- a/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h +++ b/src/core/ext/upb-generated/xds/type/matcher/v3/string.upb.h @@ -56,11 +56,15 @@ UPB_INLINE xds_type_matcher_v3_StringMatcher* xds_type_matcher_v3_StringMatcher_ 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_StringMatcher_msginit, options, arena, &ptr, len); + return ptr; } typedef enum { xds_type_matcher_v3_StringMatcher_match_pattern_exact = 1, @@ -178,11 +182,15 @@ UPB_INLINE xds_type_matcher_v3_ListStringMatcher* xds_type_matcher_v3_ListString 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_matcher_v3_ListStringMatcher_msginit, options, arena, &ptr, len); + return ptr; } 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)); diff --git a/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c b/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c index 5a1335e8c75..d41cdd429c1 100644 --- a/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c +++ b/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.c @@ -26,7 +26,7 @@ static const upb_MiniTable_Field xds_type_v3_TypedStruct__fields[2] = { 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, + UPB_SIZE(16, 32), 2, kUpb_ExtMode_NonExtendable, 2, 255, 0, }; static const upb_MiniTable *messages_layout[1] = { diff --git a/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h b/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h index 2a0ceed651c..51500aa50bd 100644 --- a/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h +++ b/src/core/ext/upb-generated/xds/type/v3/typed_struct.upb.h @@ -53,11 +53,15 @@ UPB_INLINE xds_type_v3_TypedStruct* xds_type_v3_TypedStruct_parse_ex(const char* 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_v3_TypedStruct_msginit, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &xds_type_v3_TypedStruct_msginit, options, arena, &ptr, len); + return ptr; } 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); diff --git a/src/core/ext/xds/upb_utils.h b/src/core/ext/xds/upb_utils.h index 9141c68b568..bef95f74b2d 100644 --- a/src/core/ext/xds/upb_utils.h +++ b/src/core/ext/xds/upb_utils.h @@ -22,6 +22,7 @@ #include #include "absl/strings/string_view.h" +#include "upb/arena.h" #include "upb/def.h" #include "upb/upb.h" diff --git a/src/core/ext/xds/xds_cluster_specifier_plugin.cc b/src/core/ext/xds/xds_cluster_specifier_plugin.cc index 4c437fa1f93..8af2046892e 100644 --- a/src/core/ext/xds/xds_cluster_specifier_plugin.cc +++ b/src/core/ext/xds/xds_cluster_specifier_plugin.cc @@ -28,6 +28,7 @@ #include "absl/status/status.h" #include "absl/strings/str_cat.h" #include "upb/json_encode.h" +#include "upb/status.h" #include "upb/upb.hpp" #include diff --git a/src/core/ext/xds/xds_cluster_specifier_plugin.h b/src/core/ext/xds/xds_cluster_specifier_plugin.h index 710128bf3d8..068ef71cff0 100644 --- a/src/core/ext/xds/xds_cluster_specifier_plugin.h +++ b/src/core/ext/xds/xds_cluster_specifier_plugin.h @@ -24,6 +24,7 @@ #include "absl/status/statusor.h" #include "absl/strings/string_view.h" +#include "upb/arena.h" #include "upb/def.h" #include "upb/upb.h" diff --git a/src/core/ext/xds/xds_http_fault_filter.h b/src/core/ext/xds/xds_http_fault_filter.h index fe937ef8d84..60fb5a58301 100644 --- a/src/core/ext/xds/xds_http_fault_filter.h +++ b/src/core/ext/xds/xds_http_fault_filter.h @@ -20,6 +20,7 @@ #include #include "absl/status/statusor.h" +#include "upb/arena.h" #include "upb/def.h" #include "upb/upb.h" diff --git a/src/core/ext/xds/xds_http_filters.h b/src/core/ext/xds/xds_http_filters.h index 5eb88020687..85cadc6a70b 100644 --- a/src/core/ext/xds/xds_http_filters.h +++ b/src/core/ext/xds/xds_http_filters.h @@ -26,6 +26,7 @@ #include "absl/status/statusor.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" +#include "upb/arena.h" #include "upb/def.h" #include "upb/upb.h" diff --git a/src/core/ext/xds/xds_http_rbac_filter.h b/src/core/ext/xds/xds_http_rbac_filter.h index 4cfa503ca28..1a8a91012ec 100644 --- a/src/core/ext/xds/xds_http_rbac_filter.h +++ b/src/core/ext/xds/xds_http_rbac_filter.h @@ -20,6 +20,7 @@ #include #include "absl/status/statusor.h" +#include "upb/arena.h" #include "upb/def.h" #include "upb/upb.h" diff --git a/src/core/ext/xds/xds_lb_policy_registry.cc b/src/core/ext/xds/xds_lb_policy_registry.cc index 0dd196d9064..2b44613d2fe 100644 --- a/src/core/ext/xds/xds_lb_policy_registry.cc +++ b/src/core/ext/xds/xds_lb_policy_registry.cc @@ -36,8 +36,9 @@ #include "google/protobuf/struct.upb.h" #include "google/protobuf/struct.upbdefs.h" #include "google/protobuf/wrappers.upb.h" +#include "upb/arena.h" #include "upb/json_encode.h" -#include "upb/upb.h" +#include "upb/status.h" #include "upb/upb.hpp" #include "xds/type/v3/typed_struct.upb.h" diff --git a/src/core/lib/gprpp/status_helper.cc b/src/core/lib/gprpp/status_helper.cc index 3b0aec9df85..c662f3b8f9e 100644 --- a/src/core/lib/gprpp/status_helper.cc +++ b/src/core/lib/gprpp/status_helper.cc @@ -34,6 +34,7 @@ #include "absl/time/clock.h" #include "google/protobuf/any.upb.h" #include "google/rpc/status.upb.h" +#include "upb/arena.h" #include "upb/upb.h" #include "upb/upb.hpp" diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 9a8c6bbc6a2..f46890a7f12 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -1177,13 +1177,20 @@ CORE_SOURCE_FILES = [ '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/arena.c', + 'third_party/upb/upb/array.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/extension_registry.c', + 'third_party/upb/upb/json_decode.c', 'third_party/upb/upb/json_encode.c', + 'third_party/upb/upb/map.c', + 'third_party/upb/upb/mini_table.c', 'third_party/upb/upb/msg.c', 'third_party/upb/upb/reflection.c', + 'third_party/upb/upb/status.c', 'third_party/upb/upb/table.c', 'third_party/upb/upb/text_encode.c', 'third_party/upb/upb/upb.c', diff --git a/src/upb/gen_build_yaml.py b/src/upb/gen_build_yaml.py index 939d71b3991..6d58c946187 100755 --- a/src/upb/gen_build_yaml.py +++ b/src/upb/gen_build_yaml.py @@ -32,13 +32,20 @@ try: "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/arena.c", + "third_party/upb/upb/array.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/extension_registry.c", + "third_party/upb/upb/json_decode.c", "third_party/upb/upb/json_encode.c", + "third_party/upb/upb/map.c", + "third_party/upb/upb/mini_table.c", "third_party/upb/upb/msg.c", "third_party/upb/upb/reflection.c", + "third_party/upb/upb/status.c", "third_party/upb/upb/table.c", "third_party/upb/upb/text_encode.c", "third_party/upb/upb/upb.c", @@ -47,22 +54,34 @@ try: ], 'headers': [ "third_party/upb/third_party/utf8_range/utf8_range.h", + "third_party/upb/upb/arena.h", + "third_party/upb/upb/array.h", + "third_party/upb/upb/collections.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/def.h", "third_party/upb/upb/def.hpp", "third_party/upb/upb/encode.h", + "third_party/upb/upb/extension_registry.h", + "third_party/upb/upb/internal/decode.h", + "third_party/upb/upb/internal/table.h", + "third_party/upb/upb/internal/upb.h", + "third_party/upb/upb/internal/vsnprintf_compat.h", + "third_party/upb/upb/json_decode.h", "third_party/upb/upb/json_encode.h", + "third_party/upb/upb/map.h", + "third_party/upb/upb/message_value.h", + "third_party/upb/upb/mini_table.h", + "third_party/upb/upb/mini_table.hpp", "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/reflection.hpp", + "third_party/upb/upb/status.h", "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", "src/core/ext/upb-generated/google/protobuf/descriptor.upb.h", diff --git a/third_party/README.md b/third_party/README.md index ec265370579..4425c056201 100644 --- a/third_party/README.md +++ b/third_party/README.md @@ -126,6 +126,8 @@ Since upb is vendored in the gRPC repo, you cannot use submodule to update it. P 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 + - Running `bazel query "deps(upb) union deps(json) union deps(textformat)"` + under third_party/upb would give some idea on what needs to be included. 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. diff --git a/third_party/upb/.github/workflows/bazel_tests.yml b/third_party/upb/.github/workflows/bazel_tests.yml index 35927107135..8416481ae8a 100644 --- a/third_party/upb/.github/workflows/bazel_tests.yml +++ b/third_party/upb/.github/workflows/bazel_tests.yml @@ -13,6 +13,8 @@ jobs: ubuntu: runs-on: ${{ matrix.os }} + env: + BAZEL_CACHE: --remote_cache=https://storage.googleapis.com/protobuf-bazel-cache strategy: fail-fast: false # Don't cancel all jobs if one fails. @@ -29,10 +31,22 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Cloud SDK + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + export_environment_variables: true + if: ${{ github.repository_owner == 'protocolbuffers' }} + - name: Set up Bazel read/write caching + run: echo "BAZEL_CACHE_AUTH=--google_default_credentials" >> $GITHUB_ENV + if: ${{ github.repository_owner == 'protocolbuffers' }} + - name: Set up Bazel read-only caching + run: echo "BAZEL_CACHE_AUTH=--remote_upload_local_results=false" >> $GITHUB_ENV + if: ${{ github.repository_owner != 'protocolbuffers' }} - 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 }} + run: cd ${{ github.workspace }} && PATH=/tmp/venv/bin:$PATH CC=${{ matrix.CC }} bazel test --test_output=errors $BAZEL_CACHE $BAZEL_CACHE_AUTH ... ${{ matrix.flags }} diff --git a/third_party/upb/.github/workflows/python_tests.yml b/third_party/upb/.github/workflows/python_tests.yml new file mode 100644 index 00000000000..cd282635a29 --- /dev/null +++ b/third_party/upb/.github/workflows/python_tests.yml @@ -0,0 +1,137 @@ +name: Python Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + build_wheels: + name: Build Wheels + runs-on: ubuntu-latest + if: ${{ github.repository_owner == 'protocolbuffers' }} + env: + DOCKER_IMAGE: gcr.io/protobuf-build/bazel/linux@sha256:05a41edee21f620445ca01c46b9d33be2e4d06c3d8adced4341ac5abea754baa + BAZEL_CACHE: --remote_cache=https://storage.googleapis.com/protobuf-bazel-cache --google_default_credentials + + steps: + - uses: actions/checkout@v2 + - name: Set up Cloud SDK + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} + export_environment_variables: true + - name: Use gcloud CLI + run: gcloud info + - name: Configure Docker + run: gcloud auth configure-docker + - name: Pull Docker Image + run: docker pull $DOCKER_IMAGE + - name: Build Wheels + run: cd ${{ github.workspace }} && docker run -e GOOGLE_APPLICATION_CREDENTIALS=/workspace/$(basename $GOOGLE_APPLICATION_CREDENTIALS) -v$PWD:/workspace $DOCKER_IMAGE build $BAZEL_CACHE --crosstool_top=@com_google_protobuf//toolchain:clang_suite --symlink_prefix=/ -c dbg python/dist python/dist:test_wheel + - name: Move Wheels + run: mkdir wheels && find _build/out -name 'protobuf*.whl' -exec mv '{}' wheels ';' + - uses: actions/upload-artifact@v3 + with: + name: python-wheels + path: wheels/ + + test_wheels: + name: Test Wheels + needs: build_wheels + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + include: + # Linux and Mac use the limited API, so all Python versions will use a single wheel. + # As a result we can just test the oldest and newest supported Python versions and assume + # this gives us sufficient test coverage. + - { os: ubuntu-18.04, python-version: "3.7", architecture: x64 } + - { os: macos-10.15, python-version: "3.7", architecture: x64 } + - { os: ubuntu-20.04, python-version: "3.10", architecture: x64 } + - { os: macos-12, python-version: "3.10", architecture: x64 } + # Windows uses the full API up until Python 3.10, so each of these + # jobs tests a distinct binary wheel. + - { os: windows-2019, python-version: "3.7", architecture: x86 } + - { os: windows-2019, python-version: "3.8", architecture: x86 } + - { os: windows-2019, python-version: "3.9", architecture: x86 } + - { os: windows-2019, python-version: "3.10", architecture: x86 } + - { os: windows-2019, python-version: "3.7", architecture: x64 } + - { os: windows-2019, python-version: "3.8", architecture: x64 } + - { os: windows-2019, python-version: "3.9", architecture: x64 } + - { os: windows-2019, python-version: "3.10", architecture: x64 } + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: + - name: Download Wheels + uses: actions/download-artifact@v3 + with: + name: python-wheels + path: wheels + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.architecture }} + - name: Setup Python venv + run: | + python -m pip install --upgrade pip + python -m venv env + # Windows uses 'Scripts' instead of 'bin' + source env/bin/activate || source env/Scripts/activate + echo "VIRTUAL ENV:" $VIRTUAL_ENV + - name: Install tzdata + run: pip install tzdata + # Only needed on Windows, Linux ships with tzdata. + if: ${{ contains(matrix.os, 'windows') }} + - name: Install Protobuf Wheels + run: pip install -vvv --no-index --find-links wheels protobuf protobuftests + - name: Test that module is importable + run: python -v -c 'from google._upb import _message; assert "google._upb._message.MessageMeta" in str(_message.MessageMeta)' + if: ${{ !matrix.pure_python }} + - name: Run the unit tests + run: | + TESTS=$(pip show -f protobuftests | grep pb_unit_tests.*py$ | sed 's,/,.,g' | sed 's,\\,.,g' | sed -E 's,.py$,,g') + for test in $TESTS; do + python -m unittest -v $test + done + + test_pure_python_wheels: + name: Test Pure Python Wheels + needs: build_wheels + strategy: + fail-fast: false # Don't cancel all jobs if one fails. + matrix: + python-version: ["3.7", "3.10"] + runs-on: ubuntu-latest + + steps: + - name: Download Wheels + uses: actions/download-artifact@v3 + with: + name: python-wheels + path: wheels + - name: Delete Binary Wheels + run: find wheels -type f | grep -v none-any | xargs rm + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Setup Python venv + run: | + python -m pip install --upgrade pip + python -m venv env + source env/bin/activate + echo "VIRTUAL ENV:" $VIRTUAL_ENV + - name: Install Protobuf Wheels + run: pip install -vvv --no-index --find-links wheels protobuf protobuftests + - name: Run the unit tests + run: | + TESTS=$(pip show -f protobuftests | grep _test.py | sed 's,/,.,g' | sed -E 's,.py$,,g') + for test in $TESTS; do + python -m unittest -v $test + done diff --git a/third_party/upb/BUILD b/third_party/upb/BUILD index 80a72452424..95701d1d2f9 100644 --- a/third_party/upb/BUILD +++ b/third_party/upb/BUILD @@ -79,10 +79,18 @@ upb_proto_library_copts( visibility = ["//visibility:public"], ) +package_group( + name = "friends", + packages = [], +) + # Public C/C++ libraries ####################################################### cc_library( name = "port", + hdrs = [ + "upb/internal/vsnprintf_compat.h", + ], copts = UPB_DEFAULT_COPTS, textual_hdrs = [ "upb/port_def.inc", @@ -94,36 +102,84 @@ cc_library( cc_library( name = "upb", srcs = [ + "upb/arena.c", "upb/decode.c", - "upb/decode_internal.h", "upb/encode.c", + "upb/internal/decode.h", + "upb/internal/table.h", + "upb/internal/upb.h", "upb/msg.c", "upb/msg_internal.h", + "upb/status.c", "upb/table.c", - "upb/table_internal.h", "upb/upb.c", - "upb/upb_internal.h", ], hdrs = [ + "upb/arena.h", "upb/decode.h", "upb/encode.h", + "upb/extension_registry.h", "upb/msg.h", + "upb/status.h", "upb/upb.h", "upb/upb.hpp", ], copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ + ":extension_registry", ":fastdecode", ":port", "//third_party/utf8_range", ], ) +cc_library( + name = "extension_registry", + srcs = [ + "upb/extension_registry.c", + "upb/msg.h", + "upb/msg_internal.h", + "upb/upb.h", + ], + hdrs = [ + "upb/extension_registry.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":port", + ":table", + ], +) + +cc_library( + name = "mini_descriptor", + srcs = [ + "upb/mini_descriptor.c", + ], + hdrs = [ + "upb/mini_descriptor.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":descriptor_upb_proto", + ":mini_table", + ":port", + ":reflection", + ":table", + ":upb", + ], +) + cc_library( name = "mini_table_internal", - hdrs = ["upb/msg_internal.h"], + hdrs = [ + "upb/msg_internal.h", + ], deps = [ + ":extension_registry", ":port", ":table", ":upb", @@ -132,7 +188,9 @@ cc_library( cc_library( name = "mini_table", - srcs = ["upb/mini_table.c"], + srcs = [ + "upb/mini_table.c", + ], hdrs = [ "upb/mini_table.h", "upb/mini_table.hpp", @@ -140,6 +198,27 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ + ":extension_registry", + ":mini_table_internal", + ":port", + ":upb", + ], +) + +cc_library( + name = "mini_table_accessors", + srcs = [ + "upb/internal/mini_table_accessors.h", + "upb/mini_table_accessors.c", + ], + hdrs = [ + "upb/mini_table_accessors.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":collections", + ":mini_table", ":mini_table_internal", ":port", ":upb", @@ -148,10 +227,33 @@ cc_library( cc_test( name = "mini_table_test", - srcs = ["upb/mini_table_test.cc"], + srcs = [ + "upb/internal/table.h", + "upb/mini_table_test.cc", + ], deps = [ + ":extension_registry", ":mini_table", ":mini_table_internal", + ":port", + ":upb", + "@com_google_absl//absl/container:flat_hash_set", + "@com_google_googletest//:gtest_main", + "@com_google_protobuf//:protobuf", + ], +) + +cc_test( + name = "mini_table_accessors_test", + srcs = ["upb/mini_table_accessors_test.cc"], + deps = [ + ":collections", + ":mini_table", + ":mini_table_accessors", + ":mini_table_internal", + ":test_messages_proto2_proto_upb", + ":test_messages_proto3_proto_upb", + ":test_upb_proto", ":upb", "@com_google_absl//absl/container:flat_hash_set", "@com_google_googletest//:gtest_main", @@ -165,13 +267,14 @@ cc_library( "upb/decode.h", "upb/decode_fast.c", "upb/decode_fast.h", - "upb/decode_internal.h", + "upb/internal/decode.h", + "upb/internal/upb.h", "upb/msg.h", "upb/msg_internal.h", - "upb/upb_internal.h", ], copts = UPB_DEFAULT_COPTS, deps = [ + ":extension_registry", ":port", ":table", "//third_party/utf8_range", @@ -190,6 +293,7 @@ cc_library( "upb/decode.h", "upb/decode_fast.h", "upb/encode.h", + "upb/extension_registry.h", "upb/msg.h", "upb/msg_internal.h", "upb/port_def.inc", @@ -231,6 +335,29 @@ upb_proto_reflection_library( deps = ["@com_google_protobuf//:descriptor_proto"], ) +cc_library( + name = "collections", + srcs = [ + "upb/array.c", + "upb/map.c", + ], + hdrs = [ + "upb/array.h", + "upb/collections.h", + "upb/map.h", + "upb/message_value.h", + ], + copts = UPB_DEFAULT_COPTS, + visibility = ["//visibility:public"], + deps = [ + ":descriptor_upb_proto", + ":mini_table", + ":port", + ":table", + ":upb", + ], +) + cc_library( name = "reflection", srcs = [ @@ -247,7 +374,9 @@ cc_library( copts = UPB_DEFAULT_COPTS, visibility = ["//visibility:public"], deps = [ + ":collections", ":descriptor_upb_proto", + ":mini_table", ":port", ":table", ":upb", @@ -257,8 +386,8 @@ cc_library( cc_library( name = "textformat", srcs = [ + "upb/internal/upb.h", "upb/text_encode.c", - "upb/upb_internal.h", ], hdrs = [ "upb/text_encode.h", @@ -275,9 +404,9 @@ cc_library( cc_library( name = "json", srcs = [ + "upb/internal/upb.h", "upb/json_decode.c", "upb/json_encode.c", - "upb/upb_internal.h", ], hdrs = [ "upb/json_decode.h", @@ -299,6 +428,7 @@ cc_test( srcs = ["upb/test_generated_code.cc"], deps = [ ":empty_upbdefs_proto", + ":port", ":test_messages_proto2_proto_upb", ":test_messages_proto3_proto_upb", ":test_upb_proto", @@ -342,6 +472,39 @@ upb_proto_library( deps = ["@com_google_protobuf//:test_messages_proto3_proto"], ) +proto_library( + name = "json_test_proto", + testonly = 1, + srcs = ["upb/json_test.proto"], + deps = ["@com_google_protobuf//:struct_proto"], +) + +upb_proto_library( + name = "json_test_upb_proto", + testonly = 1, + deps = [":json_test_proto"], +) + +upb_proto_reflection_library( + name = "json_test_upb_proto_reflection", + testonly = 1, + deps = [":json_test_proto"], +) + +cc_test( + name = "json_test", + srcs = ["upb/json_test.cc"], + deps = [ + ":json", + ":json_test_upb_proto", + ":json_test_upb_proto_reflection", + ":reflection", + ":struct_upb_proto", + ":upb", + "@com_google_googletest//:gtest_main", + ], +) + cc_test( name = "msg_test", srcs = ["upb/msg_test.cc"], @@ -391,6 +554,11 @@ upb_proto_reflection_library( deps = ["test_cpp_proto"], ) +upb_proto_library( + name = "struct_upb_proto", + deps = ["@com_google_protobuf//:struct_proto"], +) + upb_proto_library( name = "timestamp_upb_proto", deps = ["@com_google_protobuf//:timestamp_proto"], @@ -433,13 +601,13 @@ cc_test( upb_proto_library( name = "conformance_proto_upb", testonly = 1, - deps = ["@com_google_protobuf//:conformance_proto"], + deps = ["@com_google_protobuf//conformance:conformance_proto"], ) upb_proto_reflection_library( name = "conformance_proto_upbdefs", testonly = 1, - deps = ["@com_google_protobuf//:conformance_proto"], + deps = ["@com_google_protobuf//conformance:conformance_proto"], ) upb_proto_reflection_library( @@ -476,7 +644,7 @@ cc_binary( make_shell_script( name = "gen_test_conformance_upb", out = "test_conformance_upb.sh", - contents = "external/com_google_protobuf/conformance_test_runner " + + contents = "external/com_google_protobuf/conformance/conformance_test_runner " + " --enforce_recommended " + " --failure_list ./upb/conformance_upb_failures.txt" + " ./conformance_upb", @@ -488,7 +656,7 @@ sh_test( data = [ "upb/conformance_upb_failures.txt", ":conformance_upb", - "@com_google_protobuf//:conformance_test_runner", + "@com_google_protobuf//conformance:conformance_test_runner", ], deps = ["@bazel_tools//tools/bash/runfiles"], ) @@ -517,7 +685,7 @@ cc_binary( 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 " + + contents = "external/com_google_protobuf/conformance/conformance_test_runner " + " --enforce_recommended " + " --failure_list ./upb/conformance_upb_failures.txt" + " ./conformance_upb_dynamic_minitable", @@ -529,7 +697,7 @@ sh_test( data = [ "upb/conformance_upb_failures.txt", ":conformance_upb_dynamic_minitable", - "@com_google_protobuf//:conformance_test_runner", + "@com_google_protobuf//conformance:conformance_test_runner", ], deps = ["@bazel_tools//tools/bash/runfiles"], ) @@ -539,6 +707,9 @@ sh_test( cc_library( name = "table", hdrs = [ + "upb/arena.h", + "upb/internal/table.h", + "upb/status.h", "upb/table_internal.h", "upb/upb.h", ], @@ -562,11 +733,14 @@ upb_amalgamation( "upb.h", ], libs = [ - ":upb", - ":fastdecode", + ":collections", ":descriptor_upb_proto", - ":reflection", + ":extension_registry", + ":fastdecode", + ":mini_table", ":port", + ":reflection", + ":upb", ], ) @@ -585,13 +759,16 @@ upb_amalgamation( "php-upb.h", ], libs = [ - ":upb", - ":fastdecode", + ":collections", ":descriptor_upb_proto", ":descriptor_upb_proto_reflection", - ":reflection", - ":port", + ":extension_registry", + ":fastdecode", ":json", + ":mini_table", + ":port", + ":reflection", + ":upb", ], prefix = "php-", ) @@ -611,12 +788,15 @@ upb_amalgamation( "ruby-upb.h", ], libs = [ - ":upb", - ":fastdecode", + ":collections", ":descriptor_upb_proto", - ":reflection", - ":port", + ":extension_registry", + ":fastdecode", ":json", + ":mini_table", + ":port", + ":reflection", + ":upb", ], prefix = "ruby-", ) @@ -640,13 +820,24 @@ exports_files( filegroup( name = "cmake_files", srcs = glob([ - "google/**/*", "upbc/**/*", "upb/**/*", - "tests/**/*", "third_party/**/*", ]), visibility = ["//cmake:__pkg__"], ) # end:github_only + +# begin:google_only +# +# py_binary( +# name = "update_check_runs", +# srcs = ["update_check_runs.py"], +# main = "update_check_runs.py", +# deps = [ +# "//third_party/py/absl:app", +# ], +# ) +# +# end:google_only diff --git a/third_party/upb/DESIGN.md b/third_party/upb/DESIGN.md index 73388d037ad..aa6a2882809 100644 --- a/third_party/upb/DESIGN.md +++ b/third_party/upb/DESIGN.md @@ -68,7 +68,7 @@ typedef struct { 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 +- A pointer to an arena (the arena must be explicitly passed into any function that allocates). The upb compiler computes a layout for each message, and determines the offset for @@ -160,7 +160,7 @@ together. 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 +arenas (making one a sub-message of the other). Fuse is a very cheap operation, and an unlimited number of arenas can be fused together efficiently. ## Reflection and Descriptors diff --git a/third_party/upb/WORKSPACE b/third_party/upb/WORKSPACE index 0bd8479eccf..2748b3285f6 100644 --- a/third_party/upb/WORKSPACE +++ b/third_party/upb/WORKSPACE @@ -2,9 +2,9 @@ workspace(name = "upb") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("//bazel:workspace_deps.bzl", "upb_deps") -load("//bazel:workspace_defs.bzl", "system_python") upb_deps() +register_toolchains("@system_python//:python_toolchain") load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() @@ -42,12 +42,6 @@ http_archive( 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", diff --git a/third_party/upb/bazel/protobuf.patch b/third_party/upb/bazel/protobuf.patch index 4b3e93813cc..b942a2ab2bc 100644 --- a/third_party/upb/bazel/protobuf.patch +++ b/third_party/upb/bazel/protobuf.patch @@ -1,89 +1,54 @@ ---- 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( +--- BUILD.bazel ++++ BUILD.bazel +@@ -896,6 +896,10 @@ py_library( [ "python/google/protobuf/**/*.py", ], -- exclude = [ -- "python/google/protobuf/internal/*_test.py", -- "python/google/protobuf/internal/test_util.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') +@@ -39,6 +39,7 @@ __author__ = 'robinson@google.com (Will Robinson)' + import numbers + import operator + import os.path ++import pathlib + + from google.protobuf import unittest_import_pb2 + from google.protobuf import unittest_pb2 +@@ -617,17 +618,22 @@ def ExpectAllFieldsSet(test_case, message): + message.default_import_enum) -+ # 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 ++def _SearchUp(path, filename): ++ path = pathlib.Path(path).resolve() ++ for parent in [path] + list(path.parents): ++ file_path = parent / ('src/google/protobuf/testdata/' + filename) ++ if file_path.exists(): ++ # Found it. Load the golden file from the testdata directory. ++ return file_path.open('rb') ++ return None + - # 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. + def GoldenFile(filename): + """Finds the given golden file and returns a file object representing it.""" + + # Search up the directory tree looking for the C++ protobuf source code. +- path = '.' +- while os.path.exists(path): +- if os.path.exists(os.path.join(path, 'src/google/protobuf')): +- # Found it. Load the golden file from the testdata directory. +- full_path = os.path.join(path, 'src/google/protobuf/testdata', filename) +- return open(full_path, 'rb') +- path = os.path.join(path, '..') ++ f = _SearchUp('.', filename) or _SearchUp(__file__, filename) ++ if f: ++ return f + + # Search internally. + path = '.' diff --git a/third_party/upb/bazel/py_extension.bzl b/third_party/upb/bazel/py_extension.bzl deleted file mode 100644 index eacd39b856b..00000000000 --- a/third_party/upb/bazel/py_extension.bzl +++ /dev/null @@ -1,38 +0,0 @@ -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/third_party/upb/bazel/python_downloads.bzl b/third_party/upb/bazel/python_downloads.bzl new file mode 100644 index 00000000000..e237c936314 --- /dev/null +++ b/third_party/upb/bazel/python_downloads.bzl @@ -0,0 +1,84 @@ +"""Helper methods to download different python versions""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +limited_api_build_file = """ +cc_library( + name = "python_headers", + hdrs = glob(["**/Include/**/*.h"]), + strip_include_prefix = "Python-{}/Include", + visibility = ["//visibility:public"], +) +""" + +def python_source_archive(name, sha256): + """Helper method to create a python_headers target that will work for linux and macos. + + Args: + name: The name of the target, should be in the form python_{VERSION} + sha256: The sha256 of the python package for the specified version + """ + version = name.split("-")[1] + http_archive( + name = name, + urls = [ + "https://www.python.org/ftp/python/{0}/Python-{0}.tgz" + .format(version), + ], + sha256 = sha256, + build_file_content = limited_api_build_file.format(version), + patch_cmds = [ + "echo '#define SIZEOF_WCHAR_T 4' > Python-{}/Include/pyconfig.h" + .format(version), + ], + ) + +nuget_build_file = """ +cc_import( + name = "python_full_api", + hdrs = glob(["**/*.h"]), + shared_library = "python{0}.dll", + interface_library = "libs/python{0}.lib", + visibility = ["@upb//python:__pkg__"], +) + +cc_import( + name = "python_limited_api", + hdrs = glob(["**/*.h"]), + shared_library = "python{1}.dll", + interface_library = "libs/python{1}.lib", + visibility = ["@upb//python:__pkg__"], +) +""" + +def python_nuget_package(name, sha256): + """Helper method to create full and limited api dependencies for windows using nuget + + Args: + name: The name of the target, should be in the form nuget_python_{CPU}_{VERSION} + sha256: The sha256 of the nuget package for that version + """ + cpu = name.split("_")[2] + version = name.split("_")[3] + + full_api_lib_number = version.split(".")[0] + version.split(".")[1] + limited_api_lib_number = version.split(".")[0] + + folder_name_dict = { + "i686": "pythonx86", + "x86-64": "python", + } + + http_archive( + name = name, + urls = [ + "https://www.nuget.org/api/v2/package/{}/{}" + .format(folder_name_dict[cpu], version), + ], + sha256 = sha256, + strip_prefix = "tools", + build_file_content = + nuget_build_file.format(full_api_lib_number, limited_api_lib_number), + type = "zip", + patch_cmds = ["cp -r include/* ."], + ) diff --git a/third_party/upb/bazel/workspace_defs.bzl b/third_party/upb/bazel/system_python.bzl similarity index 79% rename from third_party/upb/bazel/workspace_defs.bzl rename to third_party/upb/bazel/system_python.bzl index 03655b24094..7e2dac92b4c 100644 --- a/third_party/upb/bazel/workspace_defs.bzl +++ b/third_party/upb/bazel/system_python.bzl @@ -27,6 +27,7 @@ _build_file = """ load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair") + cc_library( name = "python_headers", hdrs = glob(["python/**/*.h"]), @@ -36,7 +37,7 @@ cc_library( py_runtime( name = "py3_runtime", - interpreter_path = "%s", + interpreter_path = "{}", python_version = "PY3", ) @@ -52,18 +53,31 @@ toolchain( ) """ +def _get_python_version(repository_ctx): + py_program = "import sys; print(str(sys.version_info.major) + str(sys.version_info.minor))" + result = repository_ctx.execute(["python3", "-c", py_program]) + return (result.stdout).strip() + 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 None return result.stdout def _python_headers_impl(repository_ctx): path = _get_config_var(repository_ctx, "INCLUDEPY") + if not path: + # buildifier: disable=print + print("WARNING: no system python available, builds against system python will fail") + repository_ctx.file("BUILD.bazel", "") + repository_ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = None") + return repository_ctx.symlink(path, "python") python3 = repository_ctx.which("python3") - repository_ctx.file("BUILD.bazel", _build_file % python3) + python_version = _get_python_version(repository_ctx) + repository_ctx.file("BUILD.bazel", _build_file.format(python3)) + repository_ctx.file("version.bzl", "SYSTEM_PYTHON_VERSION = '{}'".format(python_version)) # The system_python() repository rule exposes Python headers from the system. # diff --git a/third_party/upb/bazel/upb_proto_library.bzl b/third_party/upb/bazel/upb_proto_library.bzl index 82af0e6af4e..cb9800ca987 100644 --- a/third_party/upb/bazel/upb_proto_library.bzl +++ b/third_party/upb/bazel/upb_proto_library.bzl @@ -210,6 +210,7 @@ def _compile_upb_protos(ctx, generator, proto_info, proto_sources): ] + [_get_real_short_path(file) for file in proto_sources], progress_message = "Generating upb protos for :" + ctx.label.name, + mnemonic = "GenUpbProtos", ) return GeneratedSrcsInfo(srcs = srcs, hdrs = hdrs) diff --git a/third_party/upb/bazel/workspace_deps.bzl b/third_party/upb/bazel/workspace_deps.bzl index db3afd7a797..655a668b8e5 100644 --- a/third_party/upb/bazel/workspace_deps.bzl +++ b/third_party/upb/bazel/workspace_deps.bzl @@ -1,6 +1,15 @@ -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") +load("//bazel:python_downloads.bzl", "python_nuget_package", "python_source_archive") +load("//bazel:system_python.bzl", "system_python") + +def _github_archive(repo, commit, **kwargs): + repo_name = repo.split("/")[-1] + http_archive( + urls = [repo + "/archive/" + commit + ".zip"], + strip_prefix = repo_name + "-" + commit, + **kwargs + ) def upb_deps(): maybe( @@ -12,18 +21,11 @@ def upb_deps(): ) maybe( - git_repository, + _github_archive, name = "com_google_protobuf", - commit = "2f91da585e96a7efe43505f714f03c7716a94ecb", - remote = "https://github.com/protocolbuffers/protobuf.git", - 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", - ], + repo = "https://github.com/protocolbuffers/protobuf", + commit = "14803e6f63d4785ecd95adeeae3ac42a728b3857", + patches = ["//bazel:protobuf.patch"], ) rules_python_version = "740825b7f74930c62f44af95c9a4c1bd428d2c53" # Latest @ 2021-06-23 @@ -42,3 +44,46 @@ def upb_deps(): strip_prefix = "bazel-skylib-main", urls = ["https://github.com/bazelbuild/bazel-skylib/archive/main.tar.gz"], ) + + system_python( + name = "system_python", + ) + + #Python Downloads + + python_source_archive( + name = "python-3.7.0", + sha256 = "85bb9feb6863e04fb1700b018d9d42d1caac178559ffa453d7e6a436e259fd0d", + ) + python_nuget_package( + name = "nuget_python_i686_3.7.0", + sha256 = "a8bb49fa1ca62ad55430fcafaca1b58015e22943e66b1a87d5e7cef2556c6a54", + ) + python_nuget_package( + name = "nuget_python_x86-64_3.7.0", + sha256 = "66eb796a5bdb1e6787b8f655a1237a6b6964af2115b7627cf4f0032cf068b4b2", + ) + python_nuget_package( + name = "nuget_python_i686_3.8.0", + sha256 = "87a6481f5eef30b42ac12c93f06f73bd0b8692f26313b76a6615d1641c4e7bca", + ) + python_nuget_package( + name = "nuget_python_x86-64_3.8.0", + sha256 = "96c61321ce90dd053c8a04f305a5f6cc6d91350b862db34440e4a4f069b708a0", + ) + python_nuget_package( + name = "nuget_python_i686_3.9.0", + sha256 = "229abecbe49dc08fe5709e0b31e70edfb3b88f23335ebfc2904c44f940fd59b6", + ) + python_nuget_package( + name = "nuget_python_x86-64_3.9.0", + sha256 = "6af58a733e7dfbfcdd50d55788134393d6ffe7ab8270effbf724bdb786558832", + ) + python_nuget_package( + name = "nuget_python_i686_3.10.0", + sha256 = "e115e102eb90ce160ab0ef7506b750a8d7ecc385bde0a496f02a54337a8bc333", + ) + python_nuget_package( + name = "nuget_python_x86-64_3.10.0", + sha256 = "4474c83c25625d93e772e926f95f4cd398a0abbb52793625fa30f39af3d2cc00", + ) diff --git a/third_party/upb/benchmarks/BUILD.googleapis b/third_party/upb/benchmarks/BUILD.googleapis index a8f31b2a608..c231cdac467 100644 --- a/third_party/upb/benchmarks/BUILD.googleapis +++ b/third_party/upb/benchmarks/BUILD.googleapis @@ -31,7 +31,7 @@ load( proto_library( name = "ads_proto", srcs = glob([ - "google/ads/googleads/v7/**/*.proto", + "google/ads/googleads/v11/**/*.proto", "google/api/**/*.proto", "google/rpc/**/*.proto", "google/longrunning/**/*.proto", diff --git a/third_party/upb/benchmarks/benchmark.cc b/third_party/upb/benchmarks/benchmark.cc index 368780e1f30..e752d3e7eb8 100644 --- a/third_party/upb/benchmarks/benchmark.cc +++ b/third_party/upb/benchmarks/benchmark.cc @@ -24,16 +24,17 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include + #include +#include "google/ads/googleads/v11/services/google_ads_service.upbdefs.h" +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/dynamic_message.h" #include "absl/container/flat_hash_set.h" #include "benchmarks/descriptor.pb.h" #include "benchmarks/descriptor.upb.h" #include "benchmarks/descriptor.upbdefs.h" #include "benchmarks/descriptor_sv.pb.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_StringView descriptor = benchmarks_descriptor_proto_upbdefinit.descriptor; @@ -135,16 +136,16 @@ template static void BM_LoadAdsDescriptor_Upb(benchmark::State& state) { size_t bytes_per_iter = 0; for (auto _ : state) { - upb::SymbolTable symtab; + upb::DefPool defpool; if (Mode == NoLayout) { - google_ads_googleads_v7_services_SearchGoogleAdsRequest_getmsgdef( - symtab.ptr()); - bytes_per_iter = _upb_DefPool_BytesLoaded(symtab.ptr()); + google_ads_googleads_v11_services_SearchGoogleAdsRequest_getmsgdef( + defpool.ptr()); + bytes_per_iter = _upb_DefPool_BytesLoaded(defpool.ptr()); } else { bytes_per_iter = 0; LoadDefInit_BuildLayout( - symtab.ptr(), - &google_ads_googleads_v7_services_google_ads_service_proto_upbdefinit, + defpool.ptr(), + &google_ads_googleads_v11_services_google_ads_service_proto_upbdefinit, &bytes_per_iter); } } @@ -156,11 +157,11 @@ BENCHMARK_TEMPLATE(BM_LoadAdsDescriptor_Upb, WithLayout); template static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) { extern _upb_DefPool_Init - google_ads_googleads_v7_services_google_ads_service_proto_upbdefinit; + google_ads_googleads_v11_services_google_ads_service_proto_upbdefinit; std::vector serialized_files; absl::flat_hash_set seen_files; CollectFileDescriptors( - &google_ads_googleads_v7_services_google_ads_service_proto_upbdefinit, + &google_ads_googleads_v11_services_google_ads_service_proto_upbdefinit, serialized_files, seen_files); size_t bytes_per_iter = 0; for (auto _ : state) { @@ -183,7 +184,7 @@ static void BM_LoadAdsDescriptor_Proto2(benchmark::State& state) { if (Mode == WithLayout) { protobuf::DynamicMessageFactory factory; const protobuf::Descriptor* d = pool.FindMessageTypeByName( - "google.ads.googleads.v7.services.SearchGoogleAdsResponse"); + "google.ads.googleads.v11.services.SearchGoogleAdsResponse"); if (!d) { printf("Failed to find descriptor.\n"); exit(1); diff --git a/third_party/upb/cmake/make_cmakelists.py b/third_party/upb/cmake/make_cmakelists.py index 29c73bb8bcb..d64c14f6f35 100755 --- a/third_party/upb/cmake/make_cmakelists.py +++ b/third_party/upb/cmake/make_cmakelists.py @@ -192,6 +192,9 @@ class BuildFileFunctions(object): def map_dep(self, arg): return arg + def package_group(self, **kwargs): + pass + class WorkspaceFileFunctions(object): def __init__(self, converter): @@ -234,6 +237,12 @@ class WorkspaceFileFunctions(object): def register_toolchains(self, toolchain): pass + def python_source_archive(self, **kwargs): + pass + + def python_nuget_package(self, **kwargs): + pass + class Converter(object): def __init__(self): diff --git a/third_party/upb/docs/style-guide.md b/third_party/upb/docs/style-guide.md new file mode 100644 index 00000000000..bc68e1a8ed3 --- /dev/null +++ b/third_party/upb/docs/style-guide.md @@ -0,0 +1,65 @@ +# C style guide + + + +Since upb is written in pure C, we supplement the +[Google C++ style guide](https://google.github.io/styleguide/cppguide.html) with +some C-specific guidance. + +Everything written here is intended to follow the spirit of the C++ style guide. + +upb is currently inconsistent about following these conventions. It is intended +that all code will be updated to match these guidelines. The priority is +converting public interfaces as these are more difficult to change later. + +## Naming + +### Functions and Types + +C does not have namespaces. Anywhere you would normally use a namespace +separator (`::`) in C++, we use an underscore (`_`) in C: + +```c++ +// C equivalent for upb::Arena::New() +upb_Arena* upb_Arena_New(); +``` + +Since we rely on `_` to be our namespace separator, we never use it to merely +separate words in function or type names: + +```c++ +// BAD: this would be interpreted as upb::FieldDef::has::default(). +bool upb_FieldDef_has_default(const upb_FieldDef* f); + +// GOOD: this is equivalent to upb::FieldDef::HasDefault(). +bool upb_FieldDef_HasDefault(const upb_FieldDef* f); +``` + +For multi-word namespaces, we use `PascalCase`: + +```c++ +// `PyUpb` is the namespace. +PyObject* PyUpb_CMessage_GetAttr(PyObject* _self, PyObject* attr); +``` + +### Private Functions and Members + +Since we do not have `private` in C++, we use a leading underscore convention +to mark internal functions and variables that should only be accessed from +upb: + +```c++ +// Internal-only function. +int64_t _upb_Int64_FromLL(); + +// Internal-only members. Underscore prefixes are only necessary when the +// structure is defined in a header file. +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; +``` diff --git a/third_party/upb/docs/vs-cpp-protos.md b/third_party/upb/docs/vs-cpp-protos.md index 5d30c54a84a..166a59f4260 100644 --- a/third_party/upb/docs/vs-cpp-protos.md +++ b/third_party/upb/docs/vs-cpp-protos.md @@ -1,3 +1,4 @@ + # upb vs. C++ Protobuf Design diff --git a/third_party/upb/docs/wrapping-upb.in.md b/third_party/upb/docs/wrapping-upb.in.md deleted file mode 100644 index 850fefe2a0e..00000000000 --- a/third_party/upb/docs/wrapping-upb.in.md +++ /dev/null @@ -1,372 +0,0 @@ - - - -# 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=< - - - -
raw ptr
unique ptr
shared (GC) ptr
>] - key2 [label=< - - - -
 
 
 
>] - 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/third_party/upb/docs/wrapping-upb.md b/third_party/upb/docs/wrapping-upb.md index ad35428db0e..68392d5d8fd 100644 --- a/third_party/upb/docs/wrapping-upb.md +++ b/third_party/upb/docs/wrapping-upb.md @@ -10,160 +10,232 @@ 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). +# Building a protobuf library on upb + +This is a guide for creating a new protobuf implementation based on upb. It +starts from the beginning and walks you through the process, highlighting +some important design choices you will need to make. + +## Overview + +A protobuf implementation consists of two main pieces: + +1. a code generator, run at compile time, to turn `.proto` files into source + files in your language (we will call this "zlang", assuming an extension of ".z"). +2. a runtime component, which implements the wire format and provides the data + structures for representing protobuf data and metadata. + +
+ +```dot {align="center"} +digraph { + rankdir=LR; + newrank=true; + node [style="rounded,filled" shape=box] + "foo.proto" -> protoc; + "foo.proto" [shape=folder]; + protoc [fillcolor=lightgrey]; + protoc -> "protoc-gen-zlang"; + "protoc-gen-zlang" -> "foo.z"; + "protoc-gen-zlang" [fillcolor=palegreen3]; + "foo.z" [shape=folder]; + labelloc="b"; + label="Compile Time"; +} +``` -## Reflection vs. Direct Access +
+ +```dot {align="center"} +digraph { + newrank=true; + node [style="rounded,filled" shape=box fillcolor=lightgrey] + "foo.z" -> "zlang/upb glue (FFI)"; + "zlang/upb glue (FFI)" -> "upb (C)"; + "zlang/upb glue (FFI)" [fillcolor=palegreen3]; + labelloc="b"; + label="Runtime"; +} +``` -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. +The parts in green are what you will need to implement. + +Note that your code generator (`protoc-gen-zlang`) does *not* need to generate +any C code (eg. `foo.c`). While upb itself is written in C, upb's parsers and +serializers are fully table-driven, which means there is never any need or even +benefit to generating C code for each proto. upb is capable of full-speed +parsing even when schema data is loaded at runtime from strings embedded into +`foo.z`. This is a key benefit of upb compared with C++ protos, which have +traditionally relied on generated parsers in `foo.pb.cc` files to achieve full +parsing speed, and suffered a ~10x speed penalty in the parser when the schema +data was loaded at runtime. + +## Prerequisites + +There are a few things that the language runtime must provide in order to wrap +upb. + +1. **FFI**: To wrap upb, your language must be able to call into a C API + through a Foreign Function Interface (FFI). Most languages support FFI in + some form, either through "native extensions" (in which you write some C + code to implement new methods in your language) or through a direct FFI (in + which you can call into regular C functions directly from your language + using a special library). +2. **Finalizers, Destructors, or Cleaners**: The runtime must provide + finalizers or destructors of some sort. There must be a way of triggering a + call to a C function when the language garbage collects 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. upb allocates memory in C space, and a finalizer is our + only way of making sure that memory is freed and does not leak. +3. **HashMap with weak values**: (optional) This is not a strong requirement, + but it is sometimes helpful to have a global hashmap with weak values to act + as a `upb_msg* -> wrapper` object cache. We want the values to be weak (not + the keys). There is some question about whether we want to continue to use + this pattern going forward. + +## Reflection vs. MiniTables + +The first key design decision you will need to make is whether your generated +code will access message data via reflection or minitables. Generally more +dynamic languages will want to use reflection and more static languages will +want to use minitables. ### 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); +Reflection-based data access makes the most sense in highly dynamic language +interpreters, where method dispatch is generally resolved via strings and hash +table lookups. + +In such languages, you can often implement a special method like `__getattr__` +(Python) or `method_missing` (Ruby) that receives the method name as a string. +Using upb's reflection, you can look up a field name using the method name, +thereby using a hash table belonging to upb instead of one provided by the +language. + +```python +class FooMessage: + # Written in Python for illustration, but in practice we will want to + # implement this in C for speed. + def __getattr__(self, name): + field = FooMessage.descriptor.fields_by_name[name] + return field.get_value(self) +``` - // At application exit, we free the symtab. - upb_symtab_free(symtab); +Using this design, we only need to attach a single `__getattr__` method to each +message class, instead of defining a getter/setter for each field. In this way +we can avoid duplicating hash tables between upb and the language interpreter, +reducing memory usage. + +Reflection-based access requires loading full reflection at runtime. Your +generated code will need to embed serialized descriptors (ie. a serialized +message of `descriptor.proto`), which has some amount of size overhead and +exposes all message/field names to the binary. It also forces a hash table +lookup in the critical path of field access. If method calls in your language +already have this overhead, then this is no added burden, but for statically +dispatched languages it would cause extra overhead. + +If we take this path to its logical conclusion, all class creation can be +performed fully dynamically, using only a binary descriptor as input. The +"generated code" becomes little more than an embedded descriptor plus a +library call to load it. Python has recently gone down this path. Generated +code now looks something like this: + +```python +# main_pb2.py +from google3.net.proto2.python.internal import builder as _builder +from google3.net.proto2.python.public import descriptor_pool as _descriptor_pool + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile("<...>") +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'google3.main_pb2', globals()) ``` -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. +This is all the runtime needs to create all of the classes for messages defined +in that serialized descriptor. This code has no pretense of readability, but +a separate `.pyi` stub file provides a fully expanded and readable list of all +methods a user can expect to be available: -```c - upb_symtab* symtab = BuildSymtab(); +```python +# main_pb2.pyi +from google3.net.proto2.python.public import descriptor as _descriptor +from google3.net.proto2.python.public import message as _message +from typing import ClassVar as _ClassVar, Optional as _Optional - // Look up a message type in the symtab. - const upb_msgdef* m = upb_symtab_lookupmsg(symtab, "FooMessage"); +DESCRIPTOR: _descriptor.FileDescriptor - // Construct a new message of this type, via reflection. - upb_arena *arena = upb_arena_new(); - upb_msg *msg = upb_msg_new(m, arena); +class MyMessage(_message.Message): + __slots__ = ["my_field"] + MY_FIELD_FIELD_NUMBER: _ClassVar[int] + my_field: str + def __init__(self, my_field: _Optional[str] = ...) -> None: ... +``` - // 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); +To use reflection-based access: - // Free the message and symtab. - upb_arena_free(arena); - upb_symtab_free(symtab); -``` +1. Load and access descriptor data using the interfaces in google3/third_party/upb/upb/def.h. +2. Access message data using the interfaces in google3/third_party/upb/upb/reflection.h. -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. -``` +### MiniTables -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. +MiniTables are a "lite" schema representation that are much smaller that +reflection. MiniTables omit names, options, and almost everything else from the +`.proto` file, retaining only enough information to parse and serialize binary +format. -```c - // TODO: demonstrate using low-level APIs for direct field access. - // These APIs do not exist yet. -``` +MiniTables can be loaded into upb through *MiniDescriptors*. MiniDescriptors are +a byte-oriented format that can be embedded into your generated code and passed +to upb to construct MiniTables. MiniDescriptors only use printable characters, +and therefore do not require escaping when embedding them into generated code +strings. Overall the size savings of MiniDescriptors are ~60x compared with +regular descriptors. -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. +MiniTables and MiniDescriptors are a natural choice for compiled languages that +resolve method calls at compile time. For languages that are sometimes compiled +and sometimes interpreted, there might not be an obvious choice. When a method +call is statically bound, we want to remove as much overhead as possible, +especially from accessors. In the extreme case, we can use unsafe APIs to read +raw memory at a known offset: ```java -import sun.misc.Unsafe; +// Example of a maximally-optimized generated accessor. +class FooMessage { + public long getBarField() { + // Using Unsafe should give us performance that is comparable to a + // native member access. + // + // The constant "24" is obtained from upb at compile time. + sun.misc.Unsafe.getLong(this.ptr, 24); + } +} +``` -class FooProto { - private final long addr; - private final Arena arena; +This design is very low-level, and tightly couples the generated code to one +specific version of the schema and compiler. A slower but safer version would +look up a field by field number: - // 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); - } +```java +// Example of a more loosely-coupled accessor. +class FooMessage { + public long getBarField() { + // The constant "2" is the field number. Internally this will look + // up the number "2" in the MiniTable and use that to read the value + // from the message. + upb.glue.getLong(this.ptr, 2); + } } ``` -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. +One downside of MiniTables is that they cannot support parsing or serializing +to JSON or TextFormat, because they do now know the field names. It should be +possible to generate reflection data "on the side", into separate generated +code files, so that reflection is only pulled in if it is being used. However +APIs to do this do not exist yet. + +To use MiniTable-based 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. +1. Load and access MiniDescriptors data using the interfaces in google3/third_party/upb/upb/mini_table.h. +2. Access message data using the interfaces in google3/third_party/upb/upb/mini_table_accessors.h. ## Memory Management @@ -180,18 +252,40 @@ 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 @@ -201,9 +295,30 @@ 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 @@ -222,9 +337,78 @@ 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=< + + + +
raw ptr
unique ptr
shared (GC) ptr
>] + key2 [label=< + + + +
 
 
 
>] + 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: diff --git a/third_party/upb/docs/wrapping-upb/1.svg b/third_party/upb/docs/wrapping-upb/1.svg deleted file mode 100644 index bb918324e20..00000000000 --- a/third_party/upb/docs/wrapping-upb/1.svg +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - -G - - - -upb_msg - -upb Message - - - -upb_msg2 - -upb Message - - - -upb_msg->upb_msg2 - - - - - -upb_array - -upb Array - - - -upb_msg->upb_array - - - - - diff --git a/third_party/upb/docs/wrapping-upb/2.svg b/third_party/upb/docs/wrapping-upb/2.svg deleted file mode 100644 index 7752f820781..00000000000 --- a/third_party/upb/docs/wrapping-upb/2.svg +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - -G - - -cluster_0 - -upb Arena - - - -upb_msg - -upb Message - - - -upb_array - -upb Array - - - -upb_msg->upb_array - - - - - -upb_msg2 - -upb Message - - - -upb_msg->upb_msg2 - - - - - diff --git a/third_party/upb/docs/wrapping-upb/3.svg b/third_party/upb/docs/wrapping-upb/3.svg deleted file mode 100644 index 495504f6c09..00000000000 --- a/third_party/upb/docs/wrapping-upb/3.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - -G - - -cluster_0 - -upb Arena 1 - - -cluster_1 - -upb Arena 2 - - - -upb_msg - -upb Message 1 - - - -upb_array - -upb Array - - - -upb_msg->upb_array - - - - - -upb_msg2 - -upb Message 2 - - - -upb_msg->upb_msg2 - - - - - -upb_msg3 - -upb Message 3 - - - -upb_msg2->upb_msg3 - - - - - diff --git a/third_party/upb/docs/wrapping-upb/4.svg b/third_party/upb/docs/wrapping-upb/4.svg deleted file mode 100644 index 2b5d2dfac0f..00000000000 --- a/third_party/upb/docs/wrapping-upb/4.svg +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - -G - - -cluster_1 - -upb Arena - - -cluster_python - - -cluster_01 - - - -upb_msg - -upb Message - - - -upb_array - -upb Array - - - -upb_msg->upb_array - - - - - -upb_msg2 - -upb Message - - - -upb_msg->upb_msg2 - - - - - - - - -py_upb_msg - -Python Message - - - -py_upb_msg->upb_msg - - - - - -py_upb_arena - -Python Arena - - - -py_upb_msg->py_upb_arena - - - - - -py_upb_msg2 - -Python Message - - - -py_upb_msg2->upb_msg2 - - - - - -py_upb_msg2->py_upb_arena - - - - - -py_upb_arena->dummy - - - - - -key -raw ptr -unique ptr -shared (GC) ptr - - - -key2 -  -  -  - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - -key:e->key2:w - - - - - - diff --git a/third_party/upb/python/BUILD b/third_party/upb/python/BUILD index ac971132b5b..3bb4a1e2b82 100644 --- a/third_party/upb/python/BUILD +++ b/third_party/upb/python/BUILD @@ -24,13 +24,154 @@ # 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") +load("//python:py_extension.bzl", "py_extension") # end:github_only +load("@bazel_skylib//lib:selects.bzl", "selects") +load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag") +load("//bazel:build_defs.bzl", "UPB_DEFAULT_COPTS") + licenses(["notice"]) +package( + default_visibility = ["//python/dist:__pkg__"], +) + +LIMITED_API_FLAG_SELECT = { + ":limited_api_3.7": ["-DPy_LIMITED_API=0x03070000"], + ":limited_api_3.10": ["-DPy_LIMITED_API=0x030a0000"], + "//conditions:default": [], +} + +bool_flag( + name = "limited_api", + build_setting_default = False, +) + +string_flag( + name = "python_version", + build_setting_default = "system", + values = [ + "system", + "37", + "38", + "39", + "310", + ], +) + +config_setting( + name = "limited_api_3.7", + flag_values = { + ":limited_api": "True", + ":python_version": "37", + }, +) + +config_setting( + name = "full_api_3.7_win32", + flag_values = { + ":limited_api": "False", + ":python_version": "37", + }, + values = {"cpu": "win32"}, +) + +config_setting( + name = "full_api_3.7_win64", + flag_values = { + ":limited_api": "False", + ":python_version": "37", + }, + values = {"cpu": "win64"}, +) + +selects.config_setting_group( + name = "full_api_3.7", + match_any = [ + ":full_api_3.7_win32", + ":full_api_3.7_win64", + ], +) + +config_setting( + name = "full_api_3.8_win32", + flag_values = { + ":limited_api": "False", + ":python_version": "38", + }, + values = {"cpu": "win32"}, +) + +config_setting( + name = "full_api_3.8_win64", + flag_values = { + ":limited_api": "False", + ":python_version": "38", + }, + values = {"cpu": "win64"}, +) + +selects.config_setting_group( + name = "full_api_3.8", + match_any = [ + ":full_api_3.8_win32", + ":full_api_3.8_win64", + ], +) + +config_setting( + name = "full_api_3.9_win32", + flag_values = { + ":limited_api": "False", + ":python_version": "39", + }, + values = {"cpu": "win32"}, +) + +config_setting( + name = "full_api_3.9_win64", + flag_values = { + ":limited_api": "False", + ":python_version": "39", + }, + values = {"cpu": "win64"}, +) + +selects.config_setting_group( + name = "full_api_3.9", + match_any = [ + "full_api_3.9_win32", + ":full_api_3.9_win64", + ], +) + +config_setting( + name = "limited_api_3.10_win32", + flag_values = { + ":limited_api": "True", + ":python_version": "310", + }, + values = {"cpu": "win32"}, +) + +config_setting( + name = "limited_api_3.10_win64", + flag_values = { + ":limited_api": "True", + ":python_version": "310", + }, + values = {"cpu": "win64"}, +) + +selects.config_setting_group( + name = "limited_api_3.10", + match_any = [ + ":limited_api_3.10_win32", + ":limited_api_3.10_win64", + ], +) + py_extension( name = "_message", srcs = [ @@ -50,11 +191,19 @@ py_extension( "message.h", "protobuf.c", "protobuf.h", - "python.h", + "python_api.h", "repeated.c", "repeated.h", + "unknown_fields.c", + "unknown_fields.h", + ], + copts = UPB_DEFAULT_COPTS + select(LIMITED_API_FLAG_SELECT) + [ + # The Python API requires patterns that are ISO C incompatible, like + # casts between function pointers and object pointers. + "-Wno-pedantic", ], deps = [ + "//:collections", "//:descriptor_upb_proto_reflection", "//:reflection", "//:table", @@ -65,100 +214,3 @@ py_extension( "//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/third_party/upb/python/convert.c b/third_party/upb/python/convert.c index 3117759c32f..215b6fe3bfb 100644 --- a/third_party/upb/python/convert.c +++ b/third_party/upb/python/convert.c @@ -66,8 +66,8 @@ PyObject* PyUpb_UpbToPy(upb_MessageValue val, const upb_FieldDef* f, return ret; } case kUpb_CType_Message: - return PyUpb_CMessage_Get((upb_Message*)val.msg_val, - upb_FieldDef_MessageSubDef(f), arena); + return PyUpb_Message_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", @@ -234,8 +234,8 @@ bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val, } } -bool PyUpb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, - const upb_MessageDef* m); +bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, + const upb_MessageDef* m); // ----------------------------------------------------------------------------- // Equal @@ -263,8 +263,8 @@ bool PyUpb_ValueEq(upb_MessageValue val1, upb_MessageValue val2, 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)); + return upb_Message_IsEqual(val1.msg_val, val2.msg_val, + upb_FieldDef_MessageSubDef(f)); default: return false; } @@ -333,8 +333,8 @@ bool PyUpb_Array_IsEqual(const upb_Array* arr1, const upb_Array* arr2, return true; } -bool PyUpb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, - const upb_MessageDef* m) { +bool upb_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; diff --git a/third_party/upb/python/convert.h b/third_party/upb/python/convert.h index cc66606af86..d26aeb72a57 100644 --- a/third_party/upb/python/convert.h +++ b/third_party/upb/python/convert.h @@ -52,12 +52,12 @@ bool PyUpb_PyToUpb(PyObject* obj, const upb_FieldDef* f, upb_MessageValue* val, 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); +// Returns true if the given messages (of type `m`) are equal. +bool upb_Message_IsEqual(const upb_Message* msg1, const upb_Message* msg2, + const upb_MessageDef* m); + #endif // PYUPB_CONVERT_H__ diff --git a/third_party/upb/python/descriptor.c b/third_party/upb/python/descriptor.c index 543c9d7a8c7..b30b3482771 100644 --- a/third_party/upb/python/descriptor.c +++ b/third_party/upb/python/descriptor.c @@ -123,16 +123,18 @@ static PyObject* PyUpb_DescriptorBase_GetOptions(PyUpb_DescriptorBase* self, 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); + char* pb; + // TODO(b/235839510): Need to correctly handle failed return codes. + (void)upb_Encode(opts, layout, 0, arena, &pb, &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); + upb_DecodeStatus ds = + upb_Decode(pb, size, opts2, upb_MessageDef_MiniTable(m), + upb_DefPool_ExtensionRegistry(symtab), 0, arena); + (void)ds; + assert(ds == kUpb_DecodeStatus_Ok); - self->options = PyUpb_CMessage_Get(opts2, m, py_arena); + self->options = PyUpb_Message_Get(opts2, m, py_arena); Py_DECREF(py_arena); } @@ -150,8 +152,9 @@ static PyObject* PyUpb_DescriptorBase_GetSerializedProto( 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; + char* pb; + upb_EncodeStatus status = upb_Encode(proto, layout, 0, arena, &pb, &size); + if (status) goto oom; // TODO(b/235839510) non-oom errors are possible here PyObject* str = PyBytes_FromStringAndSize(pb, size); upb_Arena_Free(arena); return str; @@ -167,8 +170,8 @@ static PyObject* PyUpb_DescriptorBase_CopyToProto(PyObject* _self, 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); + if (!PyUpb_Message_Verify(py_proto)) return NULL; + const upb_MessageDef* m = PyUpb_Message_GetMsgdef(py_proto); const char* type = upb_MessageDef_FullName(m); if (strcmp(type, expected_type) != 0) { PyErr_Format( @@ -180,7 +183,7 @@ static PyObject* PyUpb_DescriptorBase_CopyToProto(PyObject* _self, PyObject* serialized = PyUpb_DescriptorBase_GetSerializedProto(_self, func, layout); if (!serialized) return NULL; - PyObject* ret = PyUpb_CMessage_MergeFromString(py_proto, serialized); + PyObject* ret = PyUpb_Message_MergeFromString(py_proto, serialized); Py_DECREF(serialized); return ret; } @@ -1011,6 +1014,12 @@ static PyObject* PyUpb_FieldDescriptor_GetHasOptions( return PyBool_FromLong(upb_FieldDef_HasOptions(self->def)); } +static PyObject* PyUpb_FieldDescriptor_GetHasPresence( + PyUpb_DescriptorBase* _self, void* closure) { + PyUpb_DescriptorBase* self = (void*)_self; + return PyBool_FromLong(upb_FieldDef_HasPresence(self->def)); +} + static PyObject* PyUpb_FieldDescriptor_GetOptions(PyObject* _self, PyObject* args) { PyUpb_DescriptorBase* self = (void*)_self; @@ -1049,6 +1058,8 @@ static PyGetSetDef PyUpb_FieldDescriptor_Getters[] = { "Containing oneof"}, {"has_options", (getter)PyUpb_FieldDescriptor_GetHasOptions, NULL, "Has Options"}, + {"has_presence", (getter)PyUpb_FieldDescriptor_GetHasPresence, NULL, + "Has Presence"}, // TODO(https://github.com/protocolbuffers/upb/issues/459) //{ "_options", //(getter)NULL, (setter)SetOptions, "Options"}, { "_serialized_options", diff --git a/third_party/upb/python/descriptor.h b/third_party/upb/python/descriptor.h index 6cb6c1c2938..581e1c7a8cb 100644 --- a/third_party/upb/python/descriptor.h +++ b/third_party/upb/python/descriptor.h @@ -30,7 +30,7 @@ #include -#include "python/python.h" +#include "python/python_api.h" #include "upb/def.h" typedef enum { diff --git a/third_party/upb/python/descriptor_pool.c b/third_party/upb/python/descriptor_pool.c index 5a61b4e6c74..ea0e8132a61 100644 --- a/third_party/upb/python/descriptor_pool.c +++ b/third_party/upb/python/descriptor_pool.c @@ -217,7 +217,7 @@ static PyObject* PyUpb_DescriptorPool_DoAddSerializedFile( goto done; } const upb_MessageDef* m = PyUpb_DescriptorPool_GetFileProtoDef(); - if (PyUpb_Message_IsEqual(proto, existing, m)) { + if (upb_Message_IsEqual(proto, existing, m)) { Py_INCREF(Py_None); result = Py_None; goto done; @@ -249,8 +249,8 @@ done: 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); + if (!PyUpb_Message_Verify(file_desc)) return NULL; + const upb_MessageDef* m = PyUpb_Message_GetMsgdef(file_desc); const char* file_proto_name = PYUPB_DESCRIPTOR_PROTO_PACKAGE ".FileDescriptorProto"; if (strcmp(upb_MessageDef_FullName(m), file_proto_name) != 0) { @@ -259,7 +259,7 @@ static PyObject* PyUpb_DescriptorPool_DoAdd(PyObject* _self, PyObject* subargs = PyTuple_New(0); if (!subargs) return NULL; PyObject* serialized = - PyUpb_CMessage_SerializeToString(file_desc, subargs, NULL); + PyUpb_Message_SerializeToString(file_desc, subargs, NULL); Py_DECREF(subargs); if (!serialized) return NULL; PyObject* ret = PyUpb_DescriptorPool_DoAddSerializedFile(_self, serialized); @@ -572,11 +572,18 @@ static PyObject* PyUpb_DescriptorPool_FindAllExtensions(PyObject* _self, size_t n; const upb_FieldDef** ext = upb_DefPool_GetAllExtensions(self->symtab, m, &n); PyObject* ret = PyList_New(n); + if (!ret) goto done; for (size_t i = 0; i < n; i++) { PyObject* field = PyUpb_FieldDescriptor_Get(ext[i]); - if (!field) return NULL; + if (!field) { + Py_DECREF(ret); + ret = NULL; + goto done; + } PyList_SetItem(ret, i, field); } +done: + free(ext); return ret; } diff --git a/third_party/upb/python/extension_dict.c b/third_party/upb/python/extension_dict.c index 9fefcb06d9d..076364d96b0 100644 --- a/third_party/upb/python/extension_dict.c +++ b/third_party/upb/python/extension_dict.c @@ -52,7 +52,7 @@ 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_MessageDef* m = PyUpb_Message_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); @@ -66,7 +66,7 @@ static PyObject* PyUpb_ExtensionDict_FindExtensionByName(PyObject* _self, 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_MessageDef* m = PyUpb_Message_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); @@ -83,7 +83,7 @@ static PyObject* PyUpb_ExtensionDict_FindExtensionByNumber(PyObject* _self, } static void PyUpb_ExtensionDict_Dealloc(PyUpb_ExtensionDict* self) { - PyUpb_CMessage_ClearExtensionDict(self->msg); + PyUpb_Message_ClearExtensionDict(self->msg); Py_DECREF(self->msg); PyUpb_Dealloc(self); } @@ -107,9 +107,9 @@ static PyObject* PyUpb_ExtensionDict_RichCompare(PyObject* _self, 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); + const upb_FieldDef* f = PyUpb_Message_GetExtensionDef(self->msg, key); if (!f) return -1; - upb_Message* msg = PyUpb_CMessage_GetIfReified(self->msg); + upb_Message* msg = PyUpb_Message_GetIfReified(self->msg); if (!msg) return 0; if (upb_FieldDef_IsRepeated(f)) { upb_MessageValue val = upb_Message_Get(msg, f); @@ -121,26 +121,26 @@ static int PyUpb_ExtensionDict_Contains(PyObject* _self, PyObject* key) { static Py_ssize_t PyUpb_ExtensionDict_Length(PyObject* _self) { PyUpb_ExtensionDict* self = (PyUpb_ExtensionDict*)_self; - upb_Message* msg = PyUpb_CMessage_GetIfReified(self->msg); + upb_Message* msg = PyUpb_Message_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); + const upb_FieldDef* f = PyUpb_Message_GetExtensionDef(self->msg, key); if (!f) return NULL; - return PyUpb_CMessage_GetFieldValue(self->msg, f); + return PyUpb_Message_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); + const upb_FieldDef* f = PyUpb_Message_GetExtensionDef(self->msg, key); if (!f) return -1; if (val) { - return PyUpb_CMessage_SetFieldValue(self->msg, f, val, PyExc_TypeError); + return PyUpb_Message_SetFieldValue(self->msg, f, val, PyExc_TypeError); } else { - PyUpb_CMessage_DoClearField(self->msg, f); + PyUpb_Message_DoClearField(self->msg, f); return 0; } } @@ -207,9 +207,9 @@ static void PyUpb_ExtensionIterator_Dealloc(void* _self) { PyObject* PyUpb_ExtensionIterator_IterNext(PyObject* _self) { PyUpb_ExtensionIterator* self = (PyUpb_ExtensionIterator*)_self; - upb_Message* msg = PyUpb_CMessage_GetIfReified(self->msg); + upb_Message* msg = PyUpb_Message_GetIfReified(self->msg); if (!msg) return NULL; - const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(self->msg); + const upb_MessageDef* m = PyUpb_Message_GetMsgdef(self->msg); const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m)); while (true) { const upb_FieldDef* f; diff --git a/third_party/upb/python/extension_dict.h b/third_party/upb/python/extension_dict.h index f8a8fc43acb..a21822c0ee4 100644 --- a/third_party/upb/python/extension_dict.h +++ b/third_party/upb/python/extension_dict.h @@ -30,7 +30,7 @@ #include -#include "python/python.h" +#include "python/python_api.h" PyObject* PyUpb_ExtensionDict_New(PyObject* msg); diff --git a/third_party/upb/python/map.c b/third_party/upb/python/map.c index 35d3d325b29..5e0f6abfbe6 100644 --- a/third_party/upb/python/map.c +++ b/third_party/upb/python/map.c @@ -30,6 +30,7 @@ #include "python/convert.h" #include "python/message.h" #include "python/protobuf.h" +#include "upb/map.h" // ----------------------------------------------------------------------------- // MapContainer @@ -71,8 +72,8 @@ 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)); + PyUpb_Message_CacheDelete(self->ptr.parent, + PyUpb_MapContainer_GetField(self)); Py_DECREF(self->ptr.parent); } else { PyUpb_ObjCache_Delete(self->ptr.map); @@ -91,7 +92,7 @@ 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); + assert(PyUpb_Message_GetIfReified(parent) == NULL); PyTypeObject* cls = PyUpb_MapContainer_GetClass(f); PyUpb_MapContainer* map = (void*)PyType_GenericAlloc(cls, 0); map->arena = arena; @@ -140,11 +141,27 @@ upb_Map* PyUpb_MapContainer_EnsureReified(PyObject* _self) { 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_Message_SetConcreteSubobj(self->ptr.parent, f, msgval); PyUpb_MapContainer_Reify((PyObject*)self, map); return map; } +bool PyUpb_MapContainer_Set(PyUpb_MapContainer* self, upb_Map* map, + upb_MessageValue key, upb_MessageValue val, + upb_Arena* arena) { + switch (upb_Map_Insert(map, key, val, arena)) { + case kUpb_MapInsertStatus_Inserted: + return true; + case kUpb_MapInsertStatus_Replaced: + // We did not insert a new key, undo the previous invalidate. + self->version--; + return true; + case kUpb_MapInsertStatus_OutOfMemory: + return false; + } + return false; // Unreachable, silence compiler warning. +} + int PyUpb_MapContainer_AssignSubscript(PyObject* _self, PyObject* key, PyObject* val) { PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self; @@ -159,7 +176,7 @@ int PyUpb_MapContainer_AssignSubscript(PyObject* _self, PyObject* key, if (val) { if (!PyUpb_PyToUpb(val, val_f, &u_val, arena)) return -1; - upb_Map_Set(map, u_key, u_val, arena); + if (!PyUpb_MapContainer_Set(self, map, u_key, u_val, arena)) return -1; } else { if (!upb_Map_Delete(map, u_key)) { PyErr_Format(PyExc_KeyError, "Key not present in map"); @@ -187,7 +204,7 @@ PyObject* PyUpb_MapContainer_Subscript(PyObject* _self, PyObject* key) { } else { memset(&u_val, 0, sizeof(u_val)); } - upb_Map_Set(map, u_key, u_val, arena); + if (!PyUpb_MapContainer_Set(self, map, u_key, u_val, arena)) return false; } return PyUpb_UpbToPy(u_val, val_f, self->arena); } @@ -267,8 +284,8 @@ PyUpb_MapContainer* PyUpb_MapContainer_Check(PyObject* _self) { return (PyUpb_MapContainer*)_self; } -int PyUpb_CMessage_InitMapAttributes(PyObject* map, PyObject* value, - const upb_FieldDef* f); +int PyUpb_Message_InitMapAttributes(PyObject* map, PyObject* value, + const upb_FieldDef* f); static PyObject* PyUpb_MapContainer_MergeFrom(PyObject* _self, PyObject* _arg) { PyUpb_MapContainer* self = (PyUpb_MapContainer*)_self; @@ -278,7 +295,7 @@ static PyObject* PyUpb_MapContainer_MergeFrom(PyObject* _self, PyObject* _arg) { return PyErr_Format(PyExc_AttributeError, "Merging of dict is not allowed"); } - if (PyUpb_CMessage_InitMapAttributes(_self, _arg, f) < 0) { + if (PyUpb_Message_InitMapAttributes(_self, _arg, f) < 0) { return NULL; } diff --git a/third_party/upb/python/map.h b/third_party/upb/python/map.h index 0c03ed06dd9..aaa4e203857 100644 --- a/third_party/upb/python/map.h +++ b/third_party/upb/python/map.h @@ -30,7 +30,7 @@ #include -#include "python/python.h" +#include "python/python_api.h" #include "upb/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. diff --git a/third_party/upb/python/message.c b/third_party/upb/python/message.c index 384c5b31d15..68efb19816e 100644 --- a/third_party/upb/python/message.c +++ b/third_party/upb/python/message.c @@ -165,10 +165,10 @@ err: } // ----------------------------------------------------------------------------- -// CMessage +// Message // ----------------------------------------------------------------------------- -// The main message object. The type of the object (PyUpb_CMessage.ob_type) +// The main message object. The type of the object (PyUpb_Message.ob_type) // will be an instance of the PyUpb_MessageMeta type (defined below). So the // chain is: // FooMessage = MessageMeta(...) @@ -177,7 +177,7 @@ err: // Which becomes: // Object C Struct Type Python type (ob_type) // ----------------- ----------------- --------------------- -// foo PyUpb_CMessage FooMessage +// foo PyUpb_Message FooMessage // FooMessage PyUpb_MessageMeta message_meta_type // message_meta_type PyTypeObject 'type' in Python // @@ -186,7 +186,7 @@ err: // 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 { +typedef struct PyUpb_Message { PyObject_HEAD; PyObject* arena; uintptr_t def; // Tagged, low bit 1 == upb_FieldDef*, else upb_MessageDef* @@ -194,46 +194,46 @@ typedef struct PyUpb_CMessage { // when def is msgdef, the data for this msg. upb_Message* msg; // when def is fielddef, owning pointer to parent - struct PyUpb_CMessage* parent; + struct PyUpb_Message* 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; +} PyUpb_Message; -static PyObject* PyUpb_CMessage_GetAttr(PyObject* _self, PyObject* attr); +static PyObject* PyUpb_Message_GetAttr(PyObject* _self, PyObject* attr); -bool PyUpb_CMessage_IsStub(PyUpb_CMessage* msg) { return msg->def & 1; } +bool PyUpb_Message_IsStub(PyUpb_Message* msg) { return msg->def & 1; } -const upb_FieldDef* PyUpb_CMessage_GetFieldDef(PyUpb_CMessage* msg) { - assert(PyUpb_CMessage_IsStub(msg)); +const upb_FieldDef* PyUpb_Message_GetFieldDef(PyUpb_Message* msg) { + assert(PyUpb_Message_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)) +static const upb_MessageDef* _PyUpb_Message_GetMsgdef(PyUpb_Message* msg) { + return PyUpb_Message_IsStub(msg) + ? upb_FieldDef_MessageSubDef(PyUpb_Message_GetFieldDef(msg)) : (void*)msg->def; } -const upb_MessageDef* PyUpb_CMessage_GetMsgdef(PyObject* self) { - return _PyUpb_CMessage_GetMsgdef((PyUpb_CMessage*)self); +const upb_MessageDef* PyUpb_Message_GetMsgdef(PyObject* self) { + return _PyUpb_Message_GetMsgdef((PyUpb_Message*)self); } -static upb_Message* PyUpb_CMessage_GetMsg(PyUpb_CMessage* self) { - assert(!PyUpb_CMessage_IsStub(self)); +static upb_Message* PyUpb_Message_GetMsg(PyUpb_Message* self) { + assert(!PyUpb_Message_IsStub(self)); return self->ptr.msg; } -bool PyUpb_CMessage_TryCheck(PyObject* self) { +bool PyUpb_Message_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)) { +bool PyUpb_Message_Verify(PyObject* self) { + if (!PyUpb_Message_TryCheck(self)) { PyErr_Format(PyExc_TypeError, "Expected a message object, but got %R.", self); return false; @@ -243,15 +243,15 @@ bool PyUpb_CMessage_Verify(PyObject* self) { // 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; +upb_Message* PyUpb_Message_GetIfReified(PyObject* _self) { + PyUpb_Message* self = (void*)_self; + return PyUpb_Message_IsStub(self) ? NULL : self->ptr.msg; } -static PyObject* PyUpb_CMessage_New(PyObject* cls, PyObject* unused_args, - PyObject* unused_kwargs) { +static PyObject* PyUpb_Message_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); + PyUpb_Message* 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)); @@ -265,7 +265,7 @@ static PyObject* PyUpb_CMessage_New(PyObject* cls, PyObject* unused_args, } /* - * PyUpb_CMessage_LookupName() + * PyUpb_Message_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 @@ -273,10 +273,10 @@ static PyObject* PyUpb_CMessage_New(PyObject* cls, PyObject* unused_args, * 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) { +static bool PyUpb_Message_LookupName(PyUpb_Message* 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; @@ -291,7 +291,7 @@ static bool PyUpb_CMessage_LookupName(PyUpb_CMessage* self, PyObject* py_name, py_name); return false; } - const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); + const upb_MessageDef* msgdef = _PyUpb_Message_GetMsgdef(self); if (!upb_MessageDef_FindByNameWithSize(msgdef, name, size, f, o)) { if (exc_type) { @@ -320,7 +320,7 @@ static bool PyUpb_CMessage_LookupName(PyUpb_CMessage* self, PyObject* py_name, return true; } -static bool PyUpb_CMessage_InitMessageMapEntry(PyObject* dst, PyObject* src) { +static bool PyUpb_Message_InitMessageMapEntry(PyObject* dst, PyObject* src) { if (!src || !dst) return false; // TODO(haberman): Currently we are doing Clear()+MergeFrom(). Replace with @@ -335,8 +335,8 @@ static bool PyUpb_CMessage_InitMessageMapEntry(PyObject* dst, PyObject* src) { return true; } -int PyUpb_CMessage_InitMapAttributes(PyObject* map, PyObject* value, - const upb_FieldDef* f) { +int PyUpb_Message_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; @@ -354,7 +354,7 @@ int PyUpb_CMessage_InitMapAttributes(PyObject* map, PyObject* value, PyObject* src = PyObject_GetItem(value, e); PyObject* dst = PyObject_GetItem(map, e); Py_DECREF(e); - bool ok = PyUpb_CMessage_InitMessageMapEntry(dst, src); + bool ok = PyUpb_Message_InitMessageMapEntry(dst, src); Py_XDECREF(src); Py_XDECREF(dst); if (!ok) goto err; @@ -371,26 +371,73 @@ err: return ret; } -void PyUpb_CMessage_EnsureReified(PyUpb_CMessage* self); +void PyUpb_Message_EnsureReified(PyUpb_Message* 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); +static bool PyUpb_Message_InitMapAttribute(PyObject* _self, PyObject* name, + const upb_FieldDef* f, + PyObject* value) { + PyObject* map = PyUpb_Message_GetAttr(_self, name); + int ok = PyUpb_Message_InitMapAttributes(map, value, f); Py_DECREF(map); return ok >= 0; } -static bool PyUpb_CMessage_InitRepeatedAttribute(PyObject* _self, - PyObject* name, - PyObject* value) { +static bool PyUpb_Message_InitRepeatedMessageAttribute(PyObject* _self, + PyObject* repeated, + PyObject* value, + const upb_FieldDef* f) { + PyObject* it = PyObject_GetIter(value); + if (!it) { + PyErr_Format(PyExc_TypeError, "Argument for field %s is not iterable", + upb_FieldDef_FullName(f)); + return false; + } + PyObject* e = NULL; + PyObject* m = NULL; + while ((e = PyIter_Next(it)) != NULL) { + if (PyDict_Check(e)) { + m = PyUpb_RepeatedCompositeContainer_Add(repeated, NULL, e); + if (!m) goto err; + } else { + m = PyUpb_RepeatedCompositeContainer_Add(repeated, NULL, NULL); + if (!m) goto err; + PyObject* merged = PyUpb_Message_MergeFrom(m, e); + if (!merged) goto err; + Py_DECREF(merged); + } + Py_DECREF(e); + Py_DECREF(m); + m = NULL; + } + +err: + Py_XDECREF(it); + Py_XDECREF(e); + Py_XDECREF(m); + return !PyErr_Occurred(); // Check PyIter_Next() exit. +} + +static bool PyUpb_Message_InitRepeatedAttribute(PyObject* _self, PyObject* name, + PyObject* value) { + PyUpb_Message* self = (void*)_self; + const upb_FieldDef* field; + if (!PyUpb_Message_LookupName(self, name, &field, NULL, + PyExc_AttributeError)) { + return false; + } bool ok = false; + PyObject* repeated = PyUpb_Message_GetFieldValue(_self, field); PyObject* tmp = NULL; - PyObject* repeated = PyUpb_CMessage_GetAttr(_self, name); if (!repeated) goto err; - tmp = PyUpb_RepeatedContainer_Extend(repeated, value); - if (!tmp) goto err; + if (upb_FieldDef_IsSubMessage(field)) { + if (!PyUpb_Message_InitRepeatedMessageAttribute(_self, repeated, value, + field)) { + goto err; + } + } else { + tmp = PyUpb_RepeatedContainer_Extend(repeated, value); + if (!tmp) goto err; + } ok = true; err: @@ -399,21 +446,21 @@ err: return ok; } -static bool PyUpb_CMessage_InitMessageAttribute(PyObject* _self, PyObject* name, - PyObject* value) { - PyObject* submsg = PyUpb_CMessage_GetAttr(_self, name); +static bool PyUpb_Message_InitMessageAttribute(PyObject* _self, PyObject* name, + PyObject* value) { + PyObject* submsg = PyUpb_Message_GetAttr(_self, name); if (!submsg) return -1; assert(!PyErr_Occurred()); bool ok; - if (PyUpb_CMessage_TryCheck(value)) { - PyObject* tmp = PyUpb_CMessage_MergeFrom(submsg, value); + if (PyUpb_Message_TryCheck(value)) { + PyObject* tmp = PyUpb_Message_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; + ok = PyUpb_Message_InitAttributes(submsg, NULL, value) >= 0; } else { - const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(_self); + const upb_MessageDef* m = PyUpb_Message_GetMsgdef(_self); PyErr_Format(PyExc_TypeError, "Message must be initialized with a dict: %s", upb_MessageDef_FullName(m)); ok = false; @@ -422,10 +469,10 @@ static bool PyUpb_CMessage_InitMessageAttribute(PyObject* _self, PyObject* name, return ok; } -static bool PyUpb_CMessage_InitScalarAttribute(upb_Message* msg, - const upb_FieldDef* f, - PyObject* value, - upb_Arena* arena) { +static bool PyUpb_Message_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; @@ -433,8 +480,8 @@ static bool PyUpb_CMessage_InitScalarAttribute(upb_Message* msg, return true; } -int PyUpb_CMessage_InitAttributes(PyObject* _self, PyObject* args, - PyObject* kwargs) { +int PyUpb_Message_InitAttributes(PyObject* _self, PyObject* args, + PyObject* kwargs) { assert(!PyErr_Occurred()); if (args != NULL && PyTuple_Size(args) != 0) { @@ -444,19 +491,19 @@ int PyUpb_CMessage_InitAttributes(PyObject* _self, PyObject* args, if (kwargs == NULL) return 0; - PyUpb_CMessage* self = (void*)_self; + PyUpb_Message* self = (void*)_self; Py_ssize_t pos = 0; PyObject* name; PyObject* value; - PyUpb_CMessage_EnsureReified(self); - upb_Message* msg = PyUpb_CMessage_GetMsg(self); + PyUpb_Message_EnsureReified(self); + upb_Message* msg = PyUpb_Message_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)) { + if (!PyUpb_Message_LookupName(self, name, &f, NULL, PyExc_ValueError)) { return -1; } @@ -465,13 +512,13 @@ int PyUpb_CMessage_InitAttributes(PyObject* _self, PyObject* args, assert(!PyErr_Occurred()); if (upb_FieldDef_IsMap(f)) { - if (!PyUpb_CMessage_InitMapAttribute(_self, name, f, value)) return -1; + if (!PyUpb_Message_InitMapAttribute(_self, name, f, value)) return -1; } else if (upb_FieldDef_IsRepeated(f)) { - if (!PyUpb_CMessage_InitRepeatedAttribute(_self, name, value)) return -1; + if (!PyUpb_Message_InitRepeatedAttribute(_self, name, value)) return -1; } else if (upb_FieldDef_IsSubMessage(f)) { - if (!PyUpb_CMessage_InitMessageAttribute(_self, name, value)) return -1; + if (!PyUpb_Message_InitMessageAttribute(_self, name, value)) return -1; } else { - if (!PyUpb_CMessage_InitScalarAttribute(msg, f, value, arena)) return -1; + if (!PyUpb_Message_InitScalarAttribute(msg, f, value, arena)) return -1; } if (PyErr_Occurred()) return -1; } @@ -480,25 +527,25 @@ int PyUpb_CMessage_InitAttributes(PyObject* _self, PyObject* args, return 0; } -static int PyUpb_CMessage_Init(PyObject* _self, PyObject* args, - PyObject* kwargs) { +static int PyUpb_Message_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); + return PyUpb_Message_InitAttributes(_self, args, kwargs); } -static PyObject* PyUpb_CMessage_NewStub(PyObject* parent, const upb_FieldDef* f, - PyObject* arena) { +static PyObject* PyUpb_Message_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); + PyUpb_Message* msg = (void*)PyType_GenericAlloc((PyTypeObject*)cls, 0); msg->def = (uintptr_t)f | 1; msg->arena = arena; - msg->ptr.parent = (PyUpb_CMessage*)parent; + msg->ptr.parent = (PyUpb_Message*)parent; msg->unset_subobj_map = NULL; msg->ext_dict = NULL; msg->version = 0; @@ -509,43 +556,42 @@ static PyObject* PyUpb_CMessage_NewStub(PyObject* parent, const upb_FieldDef* f, return &msg->ob_base; } -static bool PyUpb_CMessage_IsEqual(PyUpb_CMessage* m1, PyObject* _m2) { - PyUpb_CMessage* m2 = (void*)_m2; +static bool PyUpb_Message_IsEqual(PyUpb_Message* m1, PyObject* _m2) { + PyUpb_Message* 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); + const upb_MessageDef* m1_msgdef = _PyUpb_Message_GetMsgdef(m1); #ifndef NDEBUG - const upb_MessageDef* m2_msgdef = _PyUpb_CMessage_GetMsgdef(m2); + const upb_MessageDef* m2_msgdef = _PyUpb_Message_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); + const upb_Message* m1_msg = PyUpb_Message_GetIfReified((PyObject*)m1); + const upb_Message* m2_msg = PyUpb_Message_GetIfReified(_m2); + return upb_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); +static const upb_FieldDef* PyUpb_Message_InitAsMsg(PyUpb_Message* m, + upb_Arena* arena) { + const upb_FieldDef* f = PyUpb_Message_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); +static void PyUpb_Message_SetField(PyUpb_Message* parent, const upb_FieldDef* f, + PyUpb_Message* child, upb_Arena* arena) { + upb_MessageValue msgval = {.msg_val = PyUpb_Message_GetMsg(child)}; + upb_Message_Set(PyUpb_Message_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() + * PyUpb_Message_EnsureReified() * * This implements the "expando" behavior of Python protos: * foo = FooProto() @@ -560,26 +606,26 @@ static void PyUpb_CMessage_SetField(PyUpb_CMessage* parent, * object. * * Post-condition: - * PyUpb_CMessage_IsStub(self) is false + * PyUpb_Message_IsStub(self) is false */ -void PyUpb_CMessage_EnsureReified(PyUpb_CMessage* self) { - if (!PyUpb_CMessage_IsStub(self)) return; +void PyUpb_Message_EnsureReified(PyUpb_Message* self) { + if (!PyUpb_Message_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(). + PyUpb_Message* child = self; + PyUpb_Message* parent = self->ptr.parent; + const upb_FieldDef* child_f = PyUpb_Message_InitAsMsg(child, arena); + Py_INCREF(child); // To avoid a special-case in PyUpb_Message_SetField(). do { - PyUpb_CMessage* next_parent = parent->ptr.parent; + PyUpb_Message* next_parent = parent->ptr.parent; const upb_FieldDef* parent_f = NULL; - if (PyUpb_CMessage_IsStub(parent)) { - parent_f = PyUpb_CMessage_InitAsMsg(parent, arena); + if (PyUpb_Message_IsStub(parent)) { + parent_f = PyUpb_Message_InitAsMsg(parent, arena); } - PyUpb_CMessage_SetField(parent, child_f, child, arena); + PyUpb_Message_SetField(parent, child_f, child, arena); child = parent; child_f = parent_f; parent = next_parent; @@ -590,31 +636,31 @@ void PyUpb_CMessage_EnsureReified(PyUpb_CMessage* self) { self->version++; } -static void PyUpb_CMessage_SyncSubobjs(PyUpb_CMessage* self); +static void PyUpb_Message_SyncSubobjs(PyUpb_Message* self); /* - * PyUpb_CMessage_Reify() + * PyUpb_Message_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)); +static void PyUpb_Message_Reify(PyUpb_Message* self, const upb_FieldDef* f, + upb_Message* msg) { + assert(f == PyUpb_Message_GetFieldDef(self)); if (!msg) { - const upb_MessageDef* msgdef = PyUpb_CMessage_GetMsgdef((PyObject*)self); + const upb_MessageDef* msgdef = PyUpb_Message_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_Message_SyncSubobjs(self); } /* - * PyUpb_CMessage_SyncSubobjs() + * PyUpb_Message_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 @@ -631,11 +677,11 @@ static void PyUpb_CMessage_Reify(PyUpb_CMessage* self, const upb_FieldDef* f, * 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) { +static void PyUpb_Message_SyncSubobjs(PyUpb_Message* self) { PyUpb_WeakMap* subobj_map = self->unset_subobj_map; if (!subobj_map) return; - upb_Message* msg = PyUpb_CMessage_GetMsg(self); + upb_Message* msg = PyUpb_Message_GetMsg(self); intptr_t iter = PYUPB_WEAKMAP_BEGIN; const void* key; PyObject* obj; @@ -659,9 +705,9 @@ static void PyUpb_CMessage_SyncSubobjs(PyUpb_CMessage* self) { if (!msgval.array_val) continue; PyUpb_RepeatedContainer_Reify(obj, (upb_Array*)msgval.array_val); } else { - PyUpb_CMessage* sub = (void*)obj; + PyUpb_Message* sub = (void*)obj; assert(self == sub->ptr.parent); - PyUpb_CMessage_Reify(sub, f, (upb_Message*)msgval.msg_val); + PyUpb_Message_Reify(sub, f, (upb_Message*)msgval.msg_val); } } @@ -671,12 +717,12 @@ static void PyUpb_CMessage_SyncSubobjs(PyUpb_CMessage* self) { // a WeakMap. } -static PyObject* PyUpb_CMessage_ToString(PyUpb_CMessage* self) { - if (PyUpb_CMessage_IsStub(self)) { +static PyObject* PyUpb_Message_ToString(PyUpb_Message* self) { + if (PyUpb_Message_IsStub(self)) { return PyUnicode_FromStringAndSize(NULL, 0); } - upb_Message* msg = PyUpb_CMessage_GetMsg(self); - const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); + upb_Message* msg = PyUpb_Message_GetMsg(self); + const upb_MessageDef* msgdef = _PyUpb_Message_GetMsgdef(self); const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(msgdef)); char buf[1024]; int options = UPB_TXTENC_SKIPUNKNOWN; @@ -693,37 +739,37 @@ static PyObject* PyUpb_CMessage_ToString(PyUpb_CMessage* self) { } } -static PyObject* PyUpb_CMessage_RichCompare(PyObject* _self, PyObject* other, - int opid) { - PyUpb_CMessage* self = (void*)_self; +static PyObject* PyUpb_Message_RichCompare(PyObject* _self, PyObject* other, + int opid) { + PyUpb_Message* self = (void*)_self; if (opid != Py_EQ && opid != Py_NE) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } - bool ret = PyUpb_CMessage_IsEqual(self, other); + bool ret = PyUpb_Message_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; +void PyUpb_Message_CacheDelete(PyObject* _self, const upb_FieldDef* f) { + PyUpb_Message* 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); +void PyUpb_Message_SetConcreteSubobj(PyObject* _self, const upb_FieldDef* f, + upb_MessageValue subobj) { + PyUpb_Message* self = (void*)_self; + PyUpb_Message_EnsureReified(self); + PyUpb_Message_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; +static void PyUpb_Message_Dealloc(PyObject* _self) { + PyUpb_Message* self = (void*)_self; - if (PyUpb_CMessage_IsStub(self)) { - PyUpb_CMessage_CacheDelete((PyObject*)self->ptr.parent, - PyUpb_CMessage_GetFieldDef(self)); + if (PyUpb_Message_IsStub(self)) { + PyUpb_Message_CacheDelete((PyObject*)self->ptr.parent, + PyUpb_Message_GetFieldDef(self)); Py_DECREF(self->ptr.parent); } else { PyUpb_ObjCache_Delete(self->ptr.msg); @@ -735,7 +781,7 @@ static void PyUpb_CMessage_Dealloc(PyObject* _self) { Py_DECREF(self->arena); - // We do not use PyUpb_Dealloc() here because CMessage is a base type and for + // We do not use PyUpb_Dealloc() here because Message 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); @@ -748,15 +794,15 @@ static void PyUpb_CMessage_Dealloc(PyObject* _self) { } } -PyObject* PyUpb_CMessage_Get(upb_Message* u_msg, const upb_MessageDef* m, - PyObject* arena) { +PyObject* PyUpb_Message_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); + PyUpb_Message* py_msg = (void*)PyType_GenericAlloc((PyTypeObject*)cls, 0); py_msg->arena = arena; py_msg->def = (uintptr_t)m; py_msg->ptr.msg = u_msg; @@ -770,7 +816,7 @@ PyObject* PyUpb_CMessage_Get(upb_Message* u_msg, const upb_MessageDef* m, return ret; } -/* PyUpb_CMessage_GetStub() +/* PyUpb_Message_GetStub() * * Non-present messages return "stub" objects that point to their parent, but * will materialize into real upb objects if they are mutated. @@ -791,8 +837,8 @@ PyObject* PyUpb_CMessage_Get(upb_Message* u_msg, const upb_MessageDef* m, * 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* PyUpb_Message_GetStub(PyUpb_Message* self, + const upb_FieldDef* field) { PyObject* _self = (void*)self; if (!self->unset_subobj_map) { self->unset_subobj_map = PyUpb_WeakMap_New(); @@ -806,7 +852,7 @@ PyObject* PyUpb_CMessage_GetStub(PyUpb_CMessage* self, } 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); + subobj = PyUpb_Message_NewStub(&self->ob_base, field, self->arena); } PyUpb_WeakMap_Add(self->unset_subobj_map, field, subobj); @@ -814,9 +860,9 @@ PyObject* PyUpb_CMessage_GetStub(PyUpb_CMessage* self, return subobj; } -PyObject* PyUpb_CMessage_GetPresentWrapper(PyUpb_CMessage* self, - const upb_FieldDef* field) { - assert(!PyUpb_CMessage_IsStub(self)); +PyObject* PyUpb_Message_GetPresentWrapper(PyUpb_Message* self, + const upb_FieldDef* field) { + assert(!PyUpb_Message_IsStub(self)); upb_MutableMessageValue mutval = upb_Message_Mutable(self->ptr.msg, field, PyUpb_Arena_Get(self->arena)); if (upb_FieldDef_IsMap(field)) { @@ -828,10 +874,10 @@ PyObject* PyUpb_CMessage_GetPresentWrapper(PyUpb_CMessage* self, } } -PyObject* PyUpb_CMessage_GetScalarValue(PyUpb_CMessage* self, - const upb_FieldDef* field) { +PyObject* PyUpb_Message_GetScalarValue(PyUpb_Message* self, + const upb_FieldDef* field) { upb_MessageValue val; - if (PyUpb_CMessage_IsStub(self)) { + if (PyUpb_Message_IsStub(self)) { // Unset message always returns default values. val = upb_FieldDef_Default(field); } else { @@ -841,7 +887,7 @@ PyObject* PyUpb_CMessage_GetScalarValue(PyUpb_CMessage* self, } /* - * PyUpb_CMessage_GetFieldValue() + * PyUpb_Message_GetFieldValue() * * Implements the equivalent of getattr(msg, field), once `field` has * already been resolved to a `upb_FieldDef*`. @@ -851,26 +897,26 @@ PyObject* PyUpb_CMessage_GetScalarValue(PyUpb_CMessage* self, * 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)); +PyObject* PyUpb_Message_GetFieldValue(PyObject* _self, + const upb_FieldDef* field) { + PyUpb_Message* self = (void*)_self; + assert(upb_FieldDef_ContainingType(field) == PyUpb_Message_GetMsgdef(_self)); bool submsg = upb_FieldDef_IsSubMessage(field); bool seq = upb_FieldDef_IsRepeated(field); - if ((PyUpb_CMessage_IsStub(self) && (submsg || seq)) || + if ((PyUpb_Message_IsStub(self) && (submsg || seq)) || (submsg && !seq && !upb_Message_Has(self->ptr.msg, field))) { - return PyUpb_CMessage_GetStub(self, field); + return PyUpb_Message_GetStub(self, field); } else if (seq) { - return PyUpb_CMessage_GetPresentWrapper(self, field); + return PyUpb_Message_GetPresentWrapper(self, field); } else { - return PyUpb_CMessage_GetScalarValue(self, field); + return PyUpb_Message_GetScalarValue(self, field); } } -int PyUpb_CMessage_SetFieldValue(PyObject* _self, const upb_FieldDef* field, - PyObject* value, PyObject* exc) { - PyUpb_CMessage* self = (void*)_self; +int PyUpb_Message_SetFieldValue(PyObject* _self, const upb_FieldDef* field, + PyObject* value, PyObject* exc) { + PyUpb_Message* self = (void*)_self; assert(value); if (upb_FieldDef_IsSubMessage(field) || upb_FieldDef_IsRepeated(field)) { @@ -881,7 +927,7 @@ int PyUpb_CMessage_SetFieldValue(PyObject* _self, const upb_FieldDef* field, return -1; } - PyUpb_CMessage_EnsureReified(self); + PyUpb_Message_EnsureReified(self); upb_MessageValue val; upb_Arena* arena = PyUpb_Arena_Get(self->arena); @@ -893,13 +939,13 @@ int PyUpb_CMessage_SetFieldValue(PyObject* _self, const upb_FieldDef* field, return 0; } -int PyUpb_CMessage_GetVersion(PyObject* _self) { - PyUpb_CMessage* self = (void*)_self; +int PyUpb_Message_GetVersion(PyObject* _self) { + PyUpb_Message* self = (void*)_self; return self->version; } /* - * PyUpb_CMessage_GetAttr() + * PyUpb_Message_GetAttr() * * Implements: * foo = msg.foo @@ -907,14 +953,14 @@ int PyUpb_CMessage_GetVersion(PyObject* _self) { * Attribute lookup must find both message fields and base class methods like * msg.SerializeToString(). */ -__attribute__((flatten)) static PyObject* PyUpb_CMessage_GetAttr( +__attribute__((flatten)) static PyObject* PyUpb_Message_GetAttr( PyObject* _self, PyObject* attr) { - PyUpb_CMessage* self = (void*)_self; + PyUpb_Message* 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); + if (PyUpb_Message_LookupName(self, attr, &field, NULL, NULL)) { + return PyUpb_Message_GetFieldValue(_self, field); } // Check base class attributes. @@ -937,30 +983,29 @@ __attribute__((flatten)) static PyObject* PyUpb_CMessage_GetAttr( } /* - * PyUpb_CMessage_SetAttr() + * PyUpb_Message_SetAttr() * * Implements: * msg.foo = foo */ -static int PyUpb_CMessage_SetAttr(PyObject* _self, PyObject* attr, - PyObject* value) { - PyUpb_CMessage* self = (void*)_self; +static int PyUpb_Message_SetAttr(PyObject* _self, PyObject* attr, + PyObject* value) { + PyUpb_Message* self = (void*)_self; const upb_FieldDef* field; - if (!PyUpb_CMessage_LookupName(self, attr, &field, NULL, - PyExc_AttributeError)) { + if (!PyUpb_Message_LookupName(self, attr, &field, NULL, + PyExc_AttributeError)) { return -1; } - return PyUpb_CMessage_SetFieldValue(_self, field, value, - PyExc_AttributeError); + return PyUpb_Message_SetFieldValue(_self, field, value, PyExc_AttributeError); } -static PyObject* PyUpb_CMessage_HasField(PyObject* _self, PyObject* arg) { - PyUpb_CMessage* self = (void*)_self; +static PyObject* PyUpb_Message_HasField(PyObject* _self, PyObject* arg) { + PyUpb_Message* self = (void*)_self; const upb_FieldDef* field; const upb_OneofDef* oneof; - if (!PyUpb_CMessage_LookupName(self, arg, &field, &oneof, PyExc_ValueError)) { + if (!PyUpb_Message_LookupName(self, arg, &field, &oneof, PyExc_ValueError)) { return NULL; } @@ -970,19 +1015,19 @@ static PyObject* PyUpb_CMessage_HasField(PyObject* _self, PyObject* arg) { return NULL; } - if (PyUpb_CMessage_IsStub(self)) Py_RETURN_FALSE; + if (PyUpb_Message_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_Message_FindInitializationErrors(PyObject* _self, + PyObject* arg); -static PyObject* PyUpb_CMessage_IsInitializedAppendErrors(PyObject* _self, - PyObject* errors) { - PyObject* list = PyUpb_CMessage_FindInitializationErrors(_self, NULL); +static PyObject* PyUpb_Message_IsInitializedAppendErrors(PyObject* _self, + PyObject* errors) { + PyObject* list = PyUpb_Message_FindInitializationErrors(_self, NULL); if (!list) return NULL; bool ok = PyList_Size(list) == 0; PyObject* ret = NULL; @@ -999,7 +1044,7 @@ done: return ret; } -static PyObject* PyUpb_CMessage_IsInitialized(PyObject* _self, PyObject* args) { +static PyObject* PyUpb_Message_IsInitialized(PyObject* _self, PyObject* args) { PyObject* errors = NULL; if (!PyArg_ParseTuple(args, "|O", &errors)) { return NULL; @@ -1007,27 +1052,46 @@ static PyObject* PyUpb_CMessage_IsInitialized(PyObject* _self, PyObject* args) { if (errors) { // We need to collect a list of unset required fields and append it to // `errors`. - return PyUpb_CMessage_IsInitializedAppendErrors(_self, errors); + return PyUpb_Message_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); + upb_Message* msg = PyUpb_Message_GetIfReified(_self); + const upb_MessageDef* m = PyUpb_Message_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) { +static PyObject* PyUpb_Message_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) { +static PyObject* PyUpb_Message_CheckCalledFromGeneratedFile( + PyObject* unused, PyObject* unused_arg) { + PyErr_SetString( + PyExc_TypeError, + "Descriptors cannot not be created directly.\n" + "If this call came from a _pb2.py file, your generated code is out of " + "date and must be regenerated with protoc >= 3.19.0.\n" + "If you cannot immediately regenerate your protos, some other possible " + "workarounds are:\n" + " 1. Downgrade the protobuf package to 3.20.x or lower.\n" + " 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will " + "use pure-Python parsing and will be much slower).\n" + "\n" + "More information: " + "https://developers.google.com/protocol-buffers/docs/news/" + "2022-05-06#python-updates"); + return NULL; +} + +static bool PyUpb_Message_SortFieldList(PyObject* list) { PyUpb_ModuleState* state = PyUpb_ModuleState_Get(); bool ok = false; PyObject* args = PyTuple_New(0); @@ -1050,13 +1114,13 @@ err: return ok; } -static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) { +static PyObject* PyUpb_Message_ListFields(PyObject* _self, PyObject* arg) { PyObject* list = PyList_New(0); - upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_Message_GetIfReified(_self); if (!msg) return list; size_t iter1 = kUpb_Message_Begin; - const upb_MessageDef* m = PyUpb_CMessage_GetMsgdef(_self); + const upb_MessageDef* m = PyUpb_Message_GetMsgdef(_self); const upb_DefPool* symtab = upb_FileDef_Pool(upb_MessageDef_File(m)); const upb_FieldDef* f; PyObject* field_desc = NULL; @@ -1070,7 +1134,7 @@ static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) { 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); + PyObject* py_val = PyUpb_Message_GetFieldValue(_self, f); if (!field_desc || !py_val) goto err; PyObject* tuple = Py_BuildValue("(NN)", field_desc, py_val); field_desc = NULL; @@ -1082,7 +1146,7 @@ static PyObject* PyUpb_CMessage_ListFields(PyObject* _self, PyObject* arg) { } // Users rely on fields being returned in field number order. - if (!in_order && !PyUpb_CMessage_SortFieldList(list)) goto err; + if (!in_order && !PyUpb_Message_SortFieldList(list)) goto err; return list; @@ -1094,7 +1158,7 @@ err: return NULL; } -PyObject* PyUpb_CMessage_MergeFrom(PyObject* self, PyObject* arg) { +PyObject* PyUpb_Message_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: " @@ -1104,30 +1168,30 @@ PyObject* PyUpb_CMessage_MergeFrom(PyObject* self, PyObject* arg) { } // OPT: exit if src is empty. PyObject* subargs = PyTuple_New(0); - PyObject* serialized = PyUpb_CMessage_SerializeToString(arg, subargs, NULL); + PyObject* serialized = PyUpb_Message_SerializeToString(arg, subargs, NULL); Py_DECREF(subargs); if (!serialized) return NULL; - PyObject* ret = PyUpb_CMessage_MergeFromString(self, serialized); + PyObject* ret = PyUpb_Message_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); +static PyObject* PyUpb_Message_SetInParent(PyObject* _self, PyObject* arg) { + PyUpb_Message* self = (void*)_self; + PyUpb_Message_EnsureReified(self); Py_RETURN_NONE; } -static PyObject* PyUpb_CMessage_UnknownFields(PyObject* _self, PyObject* arg) { +static PyObject* PyUpb_Message_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; +PyObject* PyUpb_Message_MergeFromString(PyObject* _self, PyObject* arg) { + PyUpb_Message* self = (void*)_self; char* buf; Py_ssize_t size; PyObject* bytes = NULL; @@ -1142,8 +1206,8 @@ PyObject* PyUpb_CMessage_MergeFromString(PyObject* _self, PyObject* arg) { return NULL; } - PyUpb_CMessage_EnsureReified(self); - const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); + PyUpb_Message_EnsureReified(self); + const upb_MessageDef* msgdef = _PyUpb_Message_GetMsgdef(self); const upb_FileDef* file = upb_MessageDef_File(msgdef); const upb_ExtensionRegistry* extreg = upb_DefPool_ExtensionRegistry(upb_FileDef_Pool(file)); @@ -1159,24 +1223,24 @@ PyObject* PyUpb_CMessage_MergeFromString(PyObject* _self, PyObject* arg) { PyErr_Format(state->decode_error_class, "Error parsing message"); return NULL; } - PyUpb_CMessage_SyncSubobjs(self); + PyUpb_Message_SyncSubobjs(self); return PyLong_FromSsize_t(size); } -static PyObject* PyUpb_CMessage_Clear(PyUpb_CMessage* self, PyObject* args); +static PyObject* PyUpb_Message_Clear(PyUpb_Message* self, PyObject* args); -static PyObject* PyUpb_CMessage_ParseFromString(PyObject* self, PyObject* arg) { - PyObject* tmp = PyUpb_CMessage_Clear((PyUpb_CMessage*)self, NULL); +static PyObject* PyUpb_Message_ParseFromString(PyObject* self, PyObject* arg) { + PyObject* tmp = PyUpb_Message_Clear((PyUpb_Message*)self, NULL); Py_DECREF(tmp); - return PyUpb_CMessage_MergeFromString(self, arg); + return PyUpb_Message_MergeFromString(self, arg); } -static PyObject* PyUpb_CMessage_ByteSize(PyObject* self, PyObject* args) { +static PyObject* PyUpb_Message_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); + PyObject* serialized = PyUpb_Message_SerializeToString(self, subargs, NULL); Py_DECREF(subargs); if (!serialized) return NULL; size_t size = PyBytes_Size(serialized); @@ -1184,13 +1248,14 @@ static PyObject* PyUpb_CMessage_ByteSize(PyObject* self, PyObject* args) { 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); +static PyObject* PyUpb_Message_Clear(PyUpb_Message* self, PyObject* args) { + PyUpb_Message_EnsureReified(self); + const upb_MessageDef* msgdef = _PyUpb_Message_GetMsgdef(self); PyUpb_WeakMap* subobj_map = self->unset_subobj_map; if (subobj_map) { - upb_Message* msg = PyUpb_CMessage_GetMsg(self); + upb_Message* msg = PyUpb_Message_GetMsg(self); + (void)msg; // Suppress unused warning when asserts are disabled. intptr_t iter = PYUPB_WEAKMAP_BEGIN; const void* key; PyObject* obj; @@ -1206,9 +1271,9 @@ static PyObject* PyUpb_CMessage_Clear(PyUpb_CMessage* self, PyObject* args) { PyUpb_RepeatedContainer_Reify(obj, NULL); } else { assert(!upb_Message_Has(msg, f)); - PyUpb_CMessage* sub = (void*)obj; + PyUpb_Message* sub = (void*)obj; assert(self == sub->ptr.parent); - PyUpb_CMessage_Reify(sub, f, NULL); + PyUpb_Message_Reify(sub, f, NULL); } } } @@ -1217,9 +1282,9 @@ static PyObject* PyUpb_CMessage_Clear(PyUpb_CMessage* self, PyObject* args) { Py_RETURN_NONE; } -void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* f) { - PyUpb_CMessage* self = (void*)_self; - PyUpb_CMessage_EnsureReified((PyUpb_CMessage*)self); +void PyUpb_Message_DoClearField(PyObject* _self, const upb_FieldDef* f) { + PyUpb_Message* self = (void*)_self; + PyUpb_Message_EnsureReified((PyUpb_Message*)self); // We must ensure that any stub object is reified so its parent no longer // points to us. @@ -1231,7 +1296,7 @@ void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* 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); + sub = PyUpb_Message_GetFieldValue(_self, f); } PyUpb_MapContainer_EnsureReified(sub); PyUpb_MapContainer_Invalidate(sub); @@ -1241,7 +1306,7 @@ void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* f) { } } else if (upb_FieldDef_IsSubMessage(f)) { if (sub) { - PyUpb_CMessage_EnsureReified((PyUpb_CMessage*)sub); + PyUpb_Message_EnsureReified((PyUpb_Message*)sub); } } @@ -1249,49 +1314,49 @@ void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* f) { 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); +static PyObject* PyUpb_Message_ClearExtension(PyObject* _self, PyObject* arg) { + PyUpb_Message* self = (void*)_self; + PyUpb_Message_EnsureReified(self); + const upb_FieldDef* f = PyUpb_Message_GetExtensionDef(_self, arg); if (!f) return NULL; - PyUpb_CMessage_DoClearField(_self, f); + PyUpb_Message_DoClearField(_self, f); Py_RETURN_NONE; } -static PyObject* PyUpb_CMessage_ClearField(PyObject* _self, PyObject* arg) { - PyUpb_CMessage* self = (void*)_self; +static PyObject* PyUpb_Message_ClearField(PyObject* _self, PyObject* arg) { + PyUpb_Message* 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); + PyUpb_Message_EnsureReified(self); const upb_FieldDef* f; const upb_OneofDef* o; - if (!PyUpb_CMessage_LookupName(self, arg, &f, &o, PyExc_ValueError)) { + if (!PyUpb_Message_LookupName(self, arg, &f, &o, PyExc_ValueError)) { return NULL; } if (o) f = upb_Message_WhichOneof(self->ptr.msg, o); - PyUpb_CMessage_DoClearField(_self, f); + PyUpb_Message_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); +static PyObject* PyUpb_Message_DiscardUnknownFields(PyUpb_Message* self, + PyObject* arg) { + PyUpb_Message_EnsureReified(self); + const upb_MessageDef* msgdef = _PyUpb_Message_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); +static PyObject* PyUpb_Message_FindInitializationErrors(PyObject* _self, + PyObject* arg) { + PyUpb_Message* self = (void*)_self; + upb_Message* msg = PyUpb_Message_GetIfReified(_self); + const upb_MessageDef* msgdef = _PyUpb_Message_GetMsgdef(self); const upb_DefPool* ext_pool = upb_FileDef_Pool(upb_MessageDef_File(msgdef)); upb_FieldPathEntry* fields; PyObject* ret = PyList_New(0); @@ -1319,14 +1384,13 @@ static PyObject* PyUpb_CMessage_FindInitializationErrors(PyObject* _self, return ret; } -static PyObject* PyUpb_CMessage_FromString(PyObject* cls, - PyObject* serialized) { +static PyObject* PyUpb_Message_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); + length = PyUpb_Message_MergeFromString(ret, serialized); if (length == NULL) goto err; done: @@ -1339,8 +1403,8 @@ err: goto done; } -const upb_FieldDef* PyUpb_CMessage_GetExtensionDef(PyObject* _self, - PyObject* key) { +const upb_FieldDef* PyUpb_Message_GetExtensionDef(PyObject* _self, + PyObject* key) { const upb_FieldDef* f = PyUpb_FieldDescriptor_GetDef(key); if (!f) { PyErr_Clear(); @@ -1352,7 +1416,7 @@ const upb_FieldDef* PyUpb_CMessage_GetExtensionDef(PyObject* _self, upb_FieldDef_FullName(f)); return NULL; } - const upb_MessageDef* msgdef = PyUpb_CMessage_GetMsgdef(_self); + const upb_MessageDef* msgdef = PyUpb_Message_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)); @@ -1361,10 +1425,10 @@ const upb_FieldDef* PyUpb_CMessage_GetExtensionDef(PyObject* _self, 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); +static PyObject* PyUpb_Message_HasExtension(PyObject* _self, + PyObject* ext_desc) { + upb_Message* msg = PyUpb_Message_GetIfReified(_self); + const upb_FieldDef* f = PyUpb_Message_GetExtensionDef(_self, ext_desc); if (!f) return NULL; if (upb_FieldDef_IsRepeated(f)) { PyErr_SetString(PyExc_KeyError, @@ -1375,9 +1439,8 @@ static PyObject* PyUpb_CMessage_HasExtension(PyObject* _self, return PyBool_FromLong(upb_Message_Has(msg, f)); } -void PyUpb_CMessage_ReportInitializationErrors(const upb_MessageDef* msgdef, - PyObject* errors, - PyObject* exc) { +void PyUpb_Message_ReportInitializationErrors(const upb_MessageDef* msgdef, + PyObject* errors, PyObject* exc) { PyObject* comma = PyUnicode_FromString(","); PyObject* missing_fields = NULL; if (!comma) goto done; @@ -1391,11 +1454,11 @@ done: 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; +PyObject* PyUpb_Message_SerializeInternal(PyObject* _self, PyObject* args, + PyObject* kwargs, + bool check_required) { + PyUpb_Message* self = (void*)_self; + if (!PyUpb_Message_Verify((PyObject*)self)) return NULL; static const char* kwlist[] = {"deterministic", NULL}; int deterministic = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|p", (char**)(kwlist), @@ -1403,19 +1466,19 @@ PyObject* PyUpb_CMessage_SerializeInternal(PyObject* _self, PyObject* args, return NULL; } - const upb_MessageDef* msgdef = _PyUpb_CMessage_GetMsgdef(self); - if (PyUpb_CMessage_IsStub(self)) { + const upb_MessageDef* msgdef = _PyUpb_Message_GetMsgdef(self); + if (PyUpb_Message_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); + PyObject* errors = PyUpb_Message_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); + PyUpb_Message_ReportInitializationErrors(msgdef, errors, + state->encode_error_class); return NULL; } @@ -1424,17 +1487,19 @@ PyObject* PyUpb_CMessage_SerializeInternal(PyObject* _self, PyObject* args, 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); + if (check_required) options |= kUpb_EncodeOption_CheckRequired; + if (deterministic) options |= kUpb_EncodeOption_Deterministic; + char* pb; + upb_EncodeStatus status = + upb_Encode(self->ptr.msg, layout, options, arena, &pb, &size); PyObject* ret = NULL; - if (!pb) { + if (status != kUpb_EncodeStatus_Ok) { PyUpb_ModuleState* state = PyUpb_ModuleState_Get(); - PyObject* errors = PyUpb_CMessage_FindInitializationErrors(_self, NULL); + PyObject* errors = PyUpb_Message_FindInitializationErrors(_self, NULL); if (PyList_Size(errors) != 0) { - PyUpb_CMessage_ReportInitializationErrors(msgdef, errors, - state->encode_error_class); + PyUpb_Message_ReportInitializationErrors(msgdef, errors, + state->encode_error_class); } else { PyErr_Format(state->encode_error_class, "Failed to serialize proto"); } @@ -1448,45 +1513,45 @@ done: return ret; } -PyObject* PyUpb_CMessage_SerializeToString(PyObject* _self, PyObject* args, - PyObject* kwargs) { - return PyUpb_CMessage_SerializeInternal(_self, args, kwargs, true); +PyObject* PyUpb_Message_SerializeToString(PyObject* _self, PyObject* args, + PyObject* kwargs) { + return PyUpb_Message_SerializeInternal(_self, args, kwargs, true); } -PyObject* PyUpb_CMessage_SerializePartialToString(PyObject* _self, - PyObject* args, - PyObject* kwargs) { - return PyUpb_CMessage_SerializeInternal(_self, args, kwargs, false); +PyObject* PyUpb_Message_SerializePartialToString(PyObject* _self, + PyObject* args, + PyObject* kwargs) { + return PyUpb_Message_SerializeInternal(_self, args, kwargs, false); } -static PyObject* PyUpb_CMessage_WhichOneof(PyObject* _self, PyObject* name) { - PyUpb_CMessage* self = (void*)_self; +static PyObject* PyUpb_Message_WhichOneof(PyObject* _self, PyObject* name) { + PyUpb_Message* self = (void*)_self; const upb_OneofDef* o; - if (!PyUpb_CMessage_LookupName(self, name, NULL, &o, PyExc_ValueError)) { + if (!PyUpb_Message_LookupName(self, name, NULL, &o, PyExc_ValueError)) { return NULL; } - upb_Message* msg = PyUpb_CMessage_GetIfReified(_self); + upb_Message* msg = PyUpb_Message_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; +void PyUpb_Message_ClearExtensionDict(PyObject* _self) { + PyUpb_Message* 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; +static PyObject* PyUpb_Message_GetExtensionDict(PyObject* _self, + void* closure) { + PyUpb_Message* self = (void*)_self; if (self->ext_dict) { Py_INCREF(self->ext_dict); return self->ext_dict; } - const upb_MessageDef* m = _PyUpb_CMessage_GetMsgdef(self); + const upb_MessageDef* m = _PyUpb_Message_GetMsgdef(self); if (upb_MessageDef_ExtensionRangeCount(m) == 0) { PyErr_SetNone(PyExc_AttributeError); return NULL; @@ -1496,91 +1561,93 @@ static PyObject* PyUpb_CMessage_GetExtensionDict(PyObject* _self, return self->ext_dict; } -static PyGetSetDef PyUpb_CMessage_Getters[] = { - {"Extensions", PyUpb_CMessage_GetExtensionDict, NULL, "Extension dict"}, +static PyGetSetDef PyUpb_Message_Getters[] = { + {"Extensions", PyUpb_Message_GetExtensionDict, NULL, "Extension dict"}, {NULL}}; -static PyMethodDef PyUpb_CMessage_Methods[] = { +static PyMethodDef PyUpb_Message_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, + {"ByteSize", (PyCFunction)PyUpb_Message_ByteSize, METH_NOARGS, "Returns the size of the message in bytes."}, - {"Clear", (PyCFunction)PyUpb_CMessage_Clear, METH_NOARGS, + {"Clear", (PyCFunction)PyUpb_Message_Clear, METH_NOARGS, "Clears the message."}, - {"ClearExtension", PyUpb_CMessage_ClearExtension, METH_O, - "Clears a message field."}, - {"ClearField", PyUpb_CMessage_ClearField, METH_O, + {"ClearExtension", PyUpb_Message_ClearExtension, METH_O, "Clears a message field."}, + {"ClearField", PyUpb_Message_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, + {"DiscardUnknownFields", (PyCFunction)PyUpb_Message_DiscardUnknownFields, METH_NOARGS, "Discards the unknown fields."}, - {"FindInitializationErrors", PyUpb_CMessage_FindInitializationErrors, + {"FindInitializationErrors", PyUpb_Message_FindInitializationErrors, METH_NOARGS, "Finds unset required fields."}, - {"FromString", PyUpb_CMessage_FromString, METH_O | METH_CLASS, + {"FromString", PyUpb_Message_FromString, METH_O | METH_CLASS, "Creates new method instance from given serialized data."}, - {"HasExtension", PyUpb_CMessage_HasExtension, METH_O, + {"HasExtension", PyUpb_Message_HasExtension, METH_O, "Checks if a message field is set."}, - {"HasField", PyUpb_CMessage_HasField, METH_O, + {"HasField", PyUpb_Message_HasField, METH_O, "Checks if a message field is set."}, - {"IsInitialized", PyUpb_CMessage_IsInitialized, METH_VARARGS, + {"IsInitialized", PyUpb_Message_IsInitialized, METH_VARARGS, "Checks if all required fields of a protocol message are set."}, - {"ListFields", PyUpb_CMessage_ListFields, METH_NOARGS, + {"ListFields", PyUpb_Message_ListFields, METH_NOARGS, "Lists all set fields of a message."}, - {"MergeFrom", PyUpb_CMessage_MergeFrom, METH_O, + {"MergeFrom", PyUpb_Message_MergeFrom, METH_O, "Merges a protocol message into the current message."}, - {"MergeFromString", PyUpb_CMessage_MergeFromString, METH_O, + {"MergeFromString", PyUpb_Message_MergeFromString, METH_O, "Merges a serialized message into the current message."}, - {"ParseFromString", PyUpb_CMessage_ParseFromString, METH_O, + {"ParseFromString", PyUpb_Message_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, + (PyCFunction)PyUpb_Message_SerializePartialToString, METH_VARARGS | METH_KEYWORDS, "Serializes the message to a string, even if it isn't initialized."}, - {"SerializeToString", (PyCFunction)PyUpb_CMessage_SerializeToString, + {"SerializeToString", (PyCFunction)PyUpb_Message_SerializeToString, METH_VARARGS | METH_KEYWORDS, "Serializes the message to a string, only for initialized messages."}, - {"SetInParent", (PyCFunction)PyUpb_CMessage_SetInParent, METH_NOARGS, + {"SetInParent", (PyCFunction)PyUpb_Message_SetInParent, METH_NOARGS, "Sets the has bit of the given field in its parent message."}, - {"UnknownFields", (PyCFunction)PyUpb_CMessage_UnknownFields, METH_NOARGS, + {"UnknownFields", (PyCFunction)PyUpb_Message_UnknownFields, METH_NOARGS, "Parse unknown field set"}, - {"WhichOneof", PyUpb_CMessage_WhichOneof, METH_O, + {"WhichOneof", PyUpb_Message_WhichOneof, METH_O, "Returns the name of the field set inside a oneof, " "or None if no field is set."}, - {"_ListFieldsItemKey", PyUpb_CMessage_ListFieldsItemKey, + {"_ListFieldsItemKey", PyUpb_Message_ListFieldsItemKey, METH_O | METH_STATIC, "Compares ListFields() list entries by field number"}, + {"_CheckCalledFromGeneratedFile", + PyUpb_Message_CheckCalledFromGeneratedFile, METH_NOARGS | METH_STATIC, + "Raises TypeError if the caller is not in a _pb2.py file."}, {NULL, NULL}}; -static PyType_Slot PyUpb_CMessage_Slots[] = { - {Py_tp_dealloc, PyUpb_CMessage_Dealloc}, +static PyType_Slot PyUpb_Message_Slots[] = { + {Py_tp_dealloc, PyUpb_Message_Dealloc}, {Py_tp_doc, "A ProtocolMessage"}, - {Py_tp_getattro, PyUpb_CMessage_GetAttr}, - {Py_tp_getset, PyUpb_CMessage_Getters}, + {Py_tp_getattro, PyUpb_Message_GetAttr}, + {Py_tp_getset, PyUpb_Message_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}, + {Py_tp_methods, PyUpb_Message_Methods}, + {Py_tp_new, PyUpb_Message_New}, + {Py_tp_str, PyUpb_Message_ToString}, + {Py_tp_repr, PyUpb_Message_ToString}, + {Py_tp_richcompare, PyUpb_Message_RichCompare}, + {Py_tp_setattro, PyUpb_Message_SetAttr}, + {Py_tp_init, PyUpb_Message_Init}, {0, NULL}}; -PyType_Spec PyUpb_CMessage_Spec = { - PYUPB_MODULE_NAME ".CMessage", // tp_name - sizeof(PyUpb_CMessage), // tp_basicsize +PyType_Spec PyUpb_Message_Spec = { + PYUPB_MODULE_NAME ".Message", // tp_name + sizeof(PyUpb_Message), // tp_basicsize 0, // tp_itemsize Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, // tp_flags - PyUpb_CMessage_Slots, + PyUpb_Message_Slots, }; // ----------------------------------------------------------------------------- @@ -1636,8 +1703,8 @@ PyObject* PyUpb_MessageMeta_DoCreateClass(PyObject* py_descriptor, if (status < 0) return NULL; // Bases are either: - // (CMessage, Message) # for regular messages - // (CMessage, Message, WktBase) # For well-known types + // (Message, Message) # for regular messages + // (Message, Message, WktBase) # For well-known types PyObject* wkt_bases = PyUpb_GetWktBases(state); PyObject* wkt_base = PyDict_GetItemString(wkt_bases, upb_MessageDef_FullName(msgdef)); @@ -1825,7 +1892,7 @@ bool PyUpb_InitMessage(PyObject* m) { PyObject* message_meta_type = PyUpb_MessageMeta_CreateType(); PyUpb_ModuleState* state = PyUpb_ModuleState_GetFromModule(m); - state->cmessage_type = PyUpb_AddClass(m, &PyUpb_CMessage_Spec); + state->cmessage_type = PyUpb_AddClass(m, &PyUpb_Message_Spec); state->message_meta_type = (PyTypeObject*)message_meta_type; if (!state->cmessage_type || !state->message_meta_type) return false; diff --git a/third_party/upb/python/message.h b/third_party/upb/python/message.h index 46155ac8afe..f296d5ce93e 100644 --- a/third_party/upb/python/message.h +++ b/third_party/upb/python/message.h @@ -34,66 +34,66 @@ #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); +void PyUpb_Message_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); +void PyUpb_Message_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); +PyObject* PyUpb_Message_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); +bool PyUpb_Message_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); +upb_Message* PyUpb_Message_GetIfReified(PyObject* _self); -// Returns the `upb_MessageDef` for a given CMessage. -const upb_MessageDef* PyUpb_CMessage_GetMsgdef(PyObject* self); +// Returns the `upb_MessageDef` for a given Message. +const upb_MessageDef* PyUpb_Message_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); +PyObject* PyUpb_Message_MergeFrom(PyObject* self, PyObject* arg); +PyObject* PyUpb_Message_MergeFromString(PyObject* self, PyObject* arg); +PyObject* PyUpb_Message_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); +int PyUpb_Message_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); +const upb_FieldDef* PyUpb_Message_GetExtensionDef(PyObject* _self, + PyObject* key); // Clears the given field in this message. -void PyUpb_CMessage_DoClearField(PyObject* _self, const upb_FieldDef* f); +void PyUpb_Message_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); +void PyUpb_Message_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); +PyObject* PyUpb_Message_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); +int PyUpb_Message_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); +int PyUpb_Message_GetVersion(PyObject* _self); // Module-level init. bool PyUpb_InitMessage(PyObject* m); diff --git a/third_party/upb/python/minimal_test.py b/third_party/upb/python/minimal_test.py index 6924ace60e8..3c0df48f3c2 100644 --- a/third_party/upb/python/minimal_test.py +++ b/third_party/upb/python/minimal_test.py @@ -29,16 +29,16 @@ import unittest from google.protobuf.pyext import _message -from google.protobuf.internal import api_implementation +from google3.net.proto2.python.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 google3.net.proto2.python.internal import factory_test1_pb2 +from google3.net.proto2.python.internal import factory_test2_pb2 +from google3.net.proto2.python.internal import more_extensions_pb2 from google.protobuf import descriptor_pb2 class TestMessageExtension(unittest.TestCase): diff --git a/third_party/upb/python/pb_unit_tests/BUILD b/third_party/upb/python/pb_unit_tests/BUILD index 1a788fe4e5f..81f3cbcb4b6 100644 --- a/third_party/upb/python/pb_unit_tests/BUILD +++ b/third_party/upb/python/pb_unit_tests/BUILD @@ -23,7 +23,7 @@ # (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") +load(":pyproto_test_wrapper.bzl", "pyproto_test_wrapper") licenses(["notice"]) @@ -45,6 +45,10 @@ pyproto_test_wrapper(name = "message_factory_test") pyproto_test_wrapper(name = "message_test") +# begin:google_only +# pyproto_test_wrapper(name = "numpy_test") +# end:google_only + pyproto_test_wrapper(name = "proto_builder_test") pyproto_test_wrapper(name = "reflection_test") @@ -62,3 +66,9 @@ pyproto_test_wrapper(name = "unknown_fields_test") pyproto_test_wrapper(name = "well_known_types_test") pyproto_test_wrapper(name = "wire_format_test") + +filegroup( + name = "test_files", + srcs = glob(["*.py"]), + visibility = ["//python/dist:__pkg__"], +) diff --git a/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py b/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py index 125533eae61..8cabf0f065e 100644 --- a/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/descriptor_database_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.descriptor_database_test import * import unittest if __name__ == '__main__': - unittest.main(module=descriptor_database_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py b/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py index 69b573c696b..ea4b27332d4 100644 --- a/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/descriptor_pool_test_wrapper.py @@ -23,26 +23,22 @@ # (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 +from google.protobuf.internal.descriptor_pool_test import * # 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 +AddDescriptorTest.testAddTypeError.__unittest_expecting_failure__ = True -descriptor_pool_test.SecondaryDescriptorFromDescriptorDB.testErrorCollector.__unittest_expecting_failure__ = True +SecondaryDescriptorFromDescriptorDB.testErrorCollector.__unittest_expecting_failure__ = True # begin:github_only if __name__ == '__main__': - unittest.main(module=descriptor_pool_test, verbosity=2) + unittest.main(verbosity=2) # end:github_only # begin:google_only +# from absl import app # if __name__ == '__main__': -# googletest.main() +# app.run(lambda argv: unittest.main(verbosity=2)) # end:google_only diff --git a/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py b/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py index 0dcaa767acb..06f01a69ca3 100644 --- a/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/descriptor_test_wrapper.py @@ -23,24 +23,24 @@ # (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 +from google.protobuf.internal.descriptor_test import * 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 +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 +MakeDescriptorTest.testCamelcaseName.__unittest_expecting_failure__ = True +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 +NewDescriptorTest.testImmutableCppDescriptor.__unittest_expecting_failure__ = True -descriptor_test.DescriptorTest.testGetDebugString.__unittest_expecting_failure__ = True +DescriptorTest.testGetDebugString.__unittest_expecting_failure__ = True if __name__ == '__main__': - unittest.main(module=descriptor_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py b/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py index c0fb964fb82..8eed1654df6 100644 --- a/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/generator_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.generator_test import * import unittest if __name__ == '__main__': - unittest.main(module=generator_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py b/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py index 5e9e69db79b..876e44d5257 100644 --- a/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/json_format_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.json_format_test import * import unittest if __name__ == '__main__': - unittest.main(module=json_format_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py b/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py index 1863b88237f..54034feb98d 100644 --- a/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/keywords_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.keywords_test import * import unittest if __name__ == '__main__': - unittest.main(module=keywords_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py b/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py index ad000a5c755..8318dcd9ba1 100644 --- a/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/message_factory_test_wrapper.py @@ -23,15 +23,15 @@ # (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 +from google.protobuf.internal.message_factory_test import * 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 +MessageFactoryTest.testCreatePrototypeOverride.__unittest_expecting_failure__ = True +MessageFactoryTest.testDuplicateExtensionNumber.__unittest_expecting_failure__ = True +MessageFactoryTest.testGetMessages.__unittest_expecting_failure__ = True +MessageFactoryTest.testGetPrototype.__unittest_expecting_failure__ = True +if hasattr(MessageFactoryTest, 'testExtensionValueInDifferentFile'): + MessageFactoryTest.testExtensionValueInDifferentFile.__unittest_expecting_failure__ = True if __name__ == '__main__': - unittest.main(module=message_factory_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/message_test_wrapper.py b/third_party/upb/python/pb_unit_tests/message_test_wrapper.py index e7a37498f76..bb1b6c7de95 100644 --- a/third_party/upb/python/pb_unit_tests/message_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/message_test_wrapper.py @@ -23,35 +23,30 @@ # (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 +from google.protobuf.internal.message_test import * 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 +MessageTest.testExtendFloatWithNothing_proto2.__unittest_expecting_failure__ = True +MessageTest.testExtendFloatWithNothing_proto3.__unittest_expecting_failure__ = True +MessageTest.testExtendInt32WithNothing_proto2.__unittest_expecting_failure__ = True +MessageTest.testExtendInt32WithNothing_proto3.__unittest_expecting_failure__ = True +MessageTest.testExtendStringWithNothing_proto2.__unittest_expecting_failure__ = True +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 +MessageTest.testFloatPrinting_proto2.__unittest_expecting_failure__ = True +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 +Proto3Test.testCopyFromBadType.__unittest_expecting_failure__ = True +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 +Proto2Test.test_documentation.__unittest_expecting_failure__ = True if __name__ == '__main__': - unittest.main(module=message_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/numpy_test_wrapper.py b/third_party/upb/python/pb_unit_tests/numpy_test_wrapper.py new file mode 100644 index 00000000000..58fecac0aa9 --- /dev/null +++ b/third_party/upb/python/pb_unit_tests/numpy_test_wrapper.py @@ -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. + +import unittest + +# begin:google_only +# from google.protobuf.internal.numpy_test import * +# +# # TODO(b/227379846): upb does not match pure-python and fast cpp behavior for +# # assignment of numpy arrays to proto float or multidimensional arrays to +# # repeated fields yet. +# NumpyFloatProtoTest.testNumpyFloatArrayToScalar_RaisesTypeError.__unittest_expecting_failure__ = True +# NumpyFloatProtoTest.testNumpyDim2FloatArrayToRepeated_RaisesTypeError.__unittest_expecting_failure__ = True +# end:google_only + +if __name__ == '__main__': + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py b/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py index d189f4950eb..0b6a25a158a 100644 --- a/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/proto_builder_test_wrapper.py @@ -23,10 +23,10 @@ # (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 +from google.protobuf.internal.proto_builder_test import * import unittest -proto_builder_test.ProtoBuilderTest.testMakeLargeProtoClass.__unittest_expecting_failure__ = True +ProtoBuilderTest.testMakeLargeProtoClass.__unittest_expecting_failure__ = True if __name__ == '__main__': - unittest.main(module=proto_builder_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/bazel/pyproto_test_wrapper.bzl b/third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl similarity index 90% rename from third_party/upb/bazel/pyproto_test_wrapper.bzl rename to third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl index 629ee9b2c6d..aa573777d2d 100644 --- a/third_party/upb/bazel/pyproto_test_wrapper.bzl +++ b/third_party/upb/python/pb_unit_tests/pyproto_test_wrapper.bzl @@ -9,9 +9,10 @@ def pyproto_test_wrapper(name): main = src, data = ["@com_google_protobuf//:testdata"], deps = [ - "//python:message_ext", + "//python:_message", "@com_google_protobuf//:python_common_test_protos", "@com_google_protobuf//:python_specific_test_protos", + "@com_google_protobuf//:python_test_srcs", "@com_google_protobuf//:python_srcs", ], ) diff --git a/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py b/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py index 35cc8ec2fbe..f9fdf6f756f 100644 --- a/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/reflection_test_wrapper.py @@ -23,25 +23,23 @@ # (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 +from google.protobuf.internal.reflection_test import * 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 +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 +SerializationTest.testCanonicalSerializationOrder.__unittest_expecting_failure__ = True +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 +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 +SerializationTest.testFieldProperties.__unittest_expecting_failure__ = True if __name__ == '__main__': - unittest.main(module=reflection_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py b/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py index 089779a3d1f..00069238de2 100644 --- a/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/service_reflection_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.service_reflection_test import * import unittest if __name__ == '__main__': - unittest.main(module=service_reflection_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py b/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py index 3a5bfb1629f..760548bd8b6 100644 --- a/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/symbol_database_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.symbol_database_test import * import unittest if __name__ == '__main__': - unittest.main(module=symbol_database_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py b/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py index 3c567bcb941..1354274135b 100644 --- a/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/text_encoding_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.text_encoding_test import * import unittest if __name__ == '__main__': - unittest.main(module=text_encoding_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py b/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py index e108e09801f..71b3d4e23a3 100644 --- a/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/text_format_test_wrapper.py @@ -23,18 +23,8 @@ # (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 +from google.protobuf.internal.text_format_test import * 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) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py b/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py index 9c352e125ae..902394fdd04 100644 --- a/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/unknown_fields_test_wrapper.py @@ -23,18 +23,8 @@ # (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 +from google.protobuf.internal.unknown_fields_test import * 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) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py b/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py index 6ded8d45258..ef3692505f7 100644 --- a/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/well_known_types_test_wrapper.py @@ -23,8 +23,9 @@ # (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 +from google.protobuf.internal.well_known_types_test import * +import os import unittest if __name__ == '__main__': - unittest.main(module=well_known_types_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py b/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py index c2f6c0acd64..f56474bc9c8 100644 --- a/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py +++ b/third_party/upb/python/pb_unit_tests/wire_format_test_wrapper.py @@ -23,8 +23,8 @@ # (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 +from google.protobuf.internal.wire_format_test import * import unittest if __name__ == '__main__': - unittest.main(module=wire_format_test, verbosity=2) + unittest.main(verbosity=2) diff --git a/third_party/upb/python/protobuf.c b/third_party/upb/python/protobuf.c index ae6b6d5c291..d3b6677728a 100644 --- a/third_party/upb/python/protobuf.c +++ b/third_party/upb/python/protobuf.c @@ -34,6 +34,7 @@ #include "python/map.h" #include "python/message.h" #include "python/repeated.h" +#include "python/unknown_fields.h" static void PyUpb_ModuleDealloc(void* module) { PyUpb_ModuleState* s = PyModule_GetState(module); @@ -130,10 +131,14 @@ PyUpb_WeakMap* PyUpb_WeakMap_New(void) { void PyUpb_WeakMap_Free(PyUpb_WeakMap* map) { upb_Arena_Free(map->arena); } +// To give better entropy in the table key, we shift away low bits that are +// always zero. +static const int PyUpb_PtrShift = (sizeof(void*) == 4) ? 2 : 3; + uintptr_t PyUpb_WeakMap_GetKey(const void* key) { uintptr_t n = (uintptr_t)key; - assert((n & 7) == 0); - return n >> 3; + assert((n & ((1 << PyUpb_PtrShift) - 1)) == 0); + return n >> PyUpb_PtrShift; } void PyUpb_WeakMap_Add(PyUpb_WeakMap* map, const void* key, PyObject* py_obj) { @@ -169,7 +174,7 @@ bool PyUpb_WeakMap_Next(PyUpb_WeakMap* map, const void** key, PyObject** obj, uintptr_t u_key; upb_value val; if (!upb_inttable_next2(&map->table, &u_key, &val, iter)) return false; - *key = (void*)(u_key << 3); + *key = (void*)(u_key << PyUpb_PtrShift); *obj = upb_value_getptr(val); return true; } @@ -321,7 +326,7 @@ PyObject* PyUpb_Forbidden_New(PyObject* cls, PyObject* args, PyObject* kwds) { // Module Entry Point // ----------------------------------------------------------------------------- -PyMODINIT_FUNC PyInit__message(void) { +__attribute__((visibility("default"))) PyMODINIT_FUNC PyInit__message(void) { PyObject* m = PyModule_Create(&module_def); if (!m) return NULL; @@ -335,7 +340,8 @@ PyMODINIT_FUNC PyInit__message(void) { 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)) { + !PyUpb_InitMessage(m) || !PyUpb_Repeated_Init(m) || + !PyUpb_UnknownFields_Init(m)) { Py_DECREF(m); return NULL; } diff --git a/third_party/upb/python/protobuf.h b/third_party/upb/python/protobuf.h index 0b87646895e..2169a60e47b 100644 --- a/third_party/upb/python/protobuf.h +++ b/third_party/upb/python/protobuf.h @@ -31,16 +31,14 @@ #include #include "python/descriptor.h" -#include "python/python.h" -#include "upb/table_internal.h" - +#include "python/python_api.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" +#define PYUPB_MODULE_NAME "google._upb._message" // end:github_only // begin:google_only @@ -108,6 +106,10 @@ typedef struct { // From repeated.c PyTypeObject* repeated_composite_container_type; PyTypeObject* repeated_scalar_container_type; + + // From unknown_fields.c + PyTypeObject* unknown_fields_type; + PyObject* unknown_field_type; } PyUpb_ModuleState; // Returns the global state object from the current interpreter. The current diff --git a/third_party/upb/python/py_extension.bzl b/third_party/upb/python/py_extension.bzl new file mode 100644 index 00000000000..a363808d61e --- /dev/null +++ b/third_party/upb/python/py_extension.bzl @@ -0,0 +1,59 @@ +"""Macro to support py_extension """ + +load("@bazel_skylib//lib:selects.bzl", "selects") + +def py_extension(name, srcs, copts, deps = []): + """Creates a C++ library to extend python + + Args: + name: Name of the target + srcs: List of source files to create the target + copts: List of C++ compile options to use + deps: Libraries that the target depends on + """ + + native.cc_binary( + name = name + "_binary", + srcs = srcs, + copts = copts + ["-fvisibility=hidden"], + linkopts = selects.with_or({ + ( + "//python/dist:osx-x86_64_cpu", + "//python/dist:osx-aarch64_cpu", + ): ["-undefined", "dynamic_lookup"], + "//python/dist:win32_cpu": ["-static-libgcc"], + "//conditions:default": [], + }), + linkshared = True, + linkstatic = True, + deps = deps + select({ + "//python:limited_api_3.7": ["@python-3.7.0//:python_headers"], + "//python:full_api_3.7_win32": ["@nuget_python_i686_3.7.0//:python_full_api"], + "//python:full_api_3.7_win64": ["@nuget_python_x86-64_3.7.0//:python_full_api"], + "//python:full_api_3.8_win32": ["@nuget_python_i686_3.8.0//:python_full_api"], + "//python:full_api_3.8_win64": ["@nuget_python_x86-64_3.8.0//:python_full_api"], + "//python:full_api_3.9_win32": ["@nuget_python_i686_3.9.0//:python_full_api"], + "//python:full_api_3.9_win64": ["@nuget_python_x86-64_3.9.0//:python_full_api"], + "//python:limited_api_3.10_win32": ["@nuget_python_i686_3.10.0//:python_limited_api"], + "//python:limited_api_3.10_win64": ["@nuget_python_x86-64_3.10.0//:python_limited_api"], + "//conditions:default": ["@system_python//:python_headers"], + }), + ) + + EXT_SUFFIX = ".abi3.so" + output_file = "google/_upb/" + name + EXT_SUFFIX + + native.genrule( + name = "copy" + name, + srcs = [":" + name + "_binary"], + outs = [output_file], + cmd = "cp $< $@", + visibility = ["//python:__subpackages__"], + ) + + native.py_library( + name = name, + data = [output_file], + imports = ["."], + visibility = ["//python:__subpackages__"], + ) diff --git a/third_party/upb/python/python_api.h b/third_party/upb/python/python_api.h new file mode 100644 index 00000000000..80496cb4ee0 --- /dev/null +++ b/third_party/upb/python/python_api.h @@ -0,0 +1,61 @@ +/* + * 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 a single build can be +// ABI-compatible with a wide range of Python versions. +// +// The build system will define Py_LIMITED_API as appropriate (see BUILD). We +// only want to define it for our distribution packages, since we can do some +// extra assertions when Py_LIMITED_API is not defined. Also Py_LIMITED_API is +// incompatible with Py_DEBUG. + +// #define Py_LIMITED_API // Defined by build system when appropriate. + +#include "Python.h" + +// Ideally we could restrict ourselves to the limited API of 3.7, but this is +// a very important function that was not officially added to the limited API +// until 3.10. Without this function, there is no way of getting data from a +// Python `str` object without a copy. +// +// While this function was not *officially* added to the limited API until +// Python 3.10, In practice it has been stable since Python 3.1. +// https://bugs.python.org/issue41784 +// +// On Linux/ELF and macOS/Mach-O, we can get away with using this function with +// the limited API prior to 3.10. + +#if (defined(__linux__) || defined(__APPLE__)) && defined(Py_LIMITED_API) && \ + Py_LIMITED_API < 0x03100000 +PyAPI_FUNC(const char*) + PyUnicode_AsUTF8AndSize(PyObject* unicode, Py_ssize_t* size); +#endif + +#endif // PYUPB_PYTHON_H__ diff --git a/third_party/upb/python/repeated.c b/third_party/upb/python/repeated.c index 16407a508fb..1c2378fcb8d 100644 --- a/third_party/upb/python/repeated.c +++ b/third_party/upb/python/repeated.c @@ -129,8 +129,8 @@ upb_Array* PyUpb_RepeatedContainer_EnsureReified(PyObject* _self) { 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_Message_SetConcreteSubobj(self->ptr.parent, f, + (upb_MessageValue){.array_val = arr}); PyUpb_RepeatedContainer_Reify((PyObject*)self, arr); return arr; } @@ -139,8 +139,8 @@ 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)); + PyUpb_Message_CacheDelete(self->ptr.parent, + PyUpb_RepeatedContainer_GetField(self)); Py_DECREF(self->ptr.parent); } else { PyUpb_ObjCache_Delete(self->ptr.arr); @@ -167,7 +167,7 @@ PyObject* PyUpb_RepeatedContainer_NewStub(PyObject* parent, 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); + assert(PyUpb_Message_GetIfReified(parent) == NULL); PyTypeObject* cls = PyUpb_RepeatedContainer_GetClass(f); PyUpb_RepeatedContainer* repeated = (void*)PyType_GenericAlloc(cls, 0); repeated->arena = arena; @@ -439,7 +439,7 @@ static int PyUpb_RepeatedContainer_AssignSubscript(PyObject* _self, PyObject* value) { PyUpb_RepeatedContainer* self = (PyUpb_RepeatedContainer*)_self; const upb_FieldDef* f = PyUpb_RepeatedContainer_GetField(self); - upb_Array* arr = PyUpb_RepeatedContainer_GetIfReified(self); + upb_Array* arr = PyUpb_RepeatedContainer_EnsureReified(_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; @@ -502,7 +502,7 @@ static bool PyUpb_RepeatedContainer_Assign(PyObject* _self, PyObject* list) { PyObject* obj = PyList_GetItem(list, i); upb_MessageValue msgval; if (submsg) { - msgval.msg_val = PyUpb_CMessage_GetIfReified(obj); + msgval.msg_val = PyUpb_Message_GetIfReified(obj); assert(msgval.msg_val); } else { if (!PyUpb_PyToUpb(obj, f, &msgval, arena)) return false; @@ -580,7 +580,7 @@ static PyObject* PyUpb_RepeatedCompositeContainer_AppendNew(PyObject* _self) { 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); + return PyUpb_Message_Get(msg, m, self->arena); } PyObject* PyUpb_RepeatedCompositeContainer_Add(PyObject* _self, PyObject* args, @@ -588,7 +588,7 @@ PyObject* PyUpb_RepeatedCompositeContainer_Add(PyObject* _self, PyObject* args, 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) { + if (PyUpb_Message_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; @@ -598,10 +598,10 @@ PyObject* PyUpb_RepeatedCompositeContainer_Add(PyObject* _self, PyObject* args, static PyObject* PyUpb_RepeatedCompositeContainer_Append(PyObject* _self, PyObject* value) { - if (!PyUpb_CMessage_Verify(value)) return NULL; + if (!PyUpb_Message_Verify(value)) return NULL; PyObject* py_msg = PyUpb_RepeatedCompositeContainer_AppendNew(_self); if (!py_msg) return NULL; - PyObject* none = PyUpb_CMessage_MergeFrom(py_msg, value); + PyObject* none = PyUpb_Message_MergeFrom(py_msg, value); if (!none) { Py_DECREF(py_msg); return NULL; @@ -632,8 +632,8 @@ static PyObject* PyUpb_RepeatedContainer_Insert(PyObject* _self, // 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); + PyObject* py_msg = PyUpb_Message_Get(msg, m, self->arena); + PyObject* ret = PyUpb_Message_MergeFrom(py_msg, value); Py_DECREF(py_msg); if (!ret) return NULL; Py_DECREF(ret); @@ -649,7 +649,6 @@ static PyObject* PyUpb_RepeatedContainer_Insert(PyObject* _self, } 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, @@ -682,6 +681,7 @@ static PyType_Slot PyUpb_RepeatedCompositeContainer_Slots[] = { {Py_mp_subscript, PyUpb_RepeatedContainer_Subscript}, {Py_mp_ass_subscript, PyUpb_RepeatedContainer_AssignSubscript}, {Py_tp_new, PyUpb_Forbidden_New}, + {Py_tp_richcompare, PyUpb_RepeatedContainer_RichCompare}, {Py_tp_hash, PyObject_HashNotImplemented}, {0, NULL}}; @@ -731,12 +731,24 @@ static int PyUpb_RepeatedScalarContainer_AssignItem(PyObject* _self, return 0; } +static PyObject* PyUpb_RepeatedScalarContainer_Reduce(PyObject* unused_self, + PyObject* unused_other) { + PyObject* pickle_module = PyImport_ImportModule("pickle"); + if (!pickle_module) return NULL; + PyObject* pickle_error = PyObject_GetAttrString(pickle_module, "PickleError"); + Py_DECREF(pickle_module); + if (!pickle_error) return NULL; + PyErr_Format(pickle_error, + "can't pickle repeated message fields, convert to list first"); + Py_DECREF(pickle_error); + return NULL; +} + 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."}, + {"__reduce__", PyUpb_RepeatedScalarContainer_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, diff --git a/third_party/upb/python/repeated.h b/third_party/upb/python/repeated.h index 9cde3eae176..5d74bd2edb0 100644 --- a/third_party/upb/python/repeated.h +++ b/third_party/upb/python/repeated.h @@ -30,7 +30,7 @@ #include -#include "python/python.h" +#include "python/python_api.h" #include "upb/def.h" // Creates a new repeated field stub for field `f` of message object `parent`. diff --git a/third_party/upb/python/unknown_fields.c b/third_party/upb/python/unknown_fields.c new file mode 100644 index 00000000000..3074632487d --- /dev/null +++ b/third_party/upb/python/unknown_fields.c @@ -0,0 +1,407 @@ +/* + * 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/unknown_fields.h" + +#include "python/message.h" +#include "python/protobuf.h" + +static const char* PyUpb_DecodeVarint(const char* ptr, const char* end, + uint64_t* val) { + *val = 0; + for (int i = 0; ptr < end && i < 10; i++, ptr++) { + uint64_t byte = (uint8_t)*ptr; + *val |= (byte & 0x7f) << (i * 7); + if ((byte & 0x80) == 0) { + return ptr + 1; + } + } + return NULL; +} + +// ----------------------------------------------------------------------------- +// UnknownFieldSet +// ----------------------------------------------------------------------------- + +typedef struct { + PyObject_HEAD; + PyObject* fields; +} PyUpb_UnknownFieldSet; + +static void PyUpb_UnknownFieldSet_Dealloc(PyObject* _self) { + PyUpb_UnknownFieldSet* self = (PyUpb_UnknownFieldSet*)_self; + Py_XDECREF(self->fields); + PyUpb_Dealloc(self); +} + +PyUpb_UnknownFieldSet* PyUpb_UnknownFieldSet_NewBare(void) { + PyUpb_ModuleState* s = PyUpb_ModuleState_Get(); + PyUpb_UnknownFieldSet* self = + (void*)PyType_GenericAlloc(s->unknown_fields_type, 0); + return self; +} + +// Generic functions to skip a value or group. + +static const char* PyUpb_UnknownFieldSet_SkipGroup(const char* ptr, + const char* end, + int group_number); + +static const char* PyUpb_UnknownFieldSet_SkipField(const char* ptr, + const char* end, + uint32_t tag) { + int field_number = tag >> 3; + int wire_type = tag & 7; + switch (wire_type) { + case kUpb_WireType_Varint: { + uint64_t val; + return PyUpb_DecodeVarint(ptr, end, &val); + } + case kUpb_WireType_64Bit: + if (end - ptr < 8) return NULL; + return ptr + 8; + case kUpb_WireType_32Bit: + if (end - ptr < 4) return NULL; + return ptr + 4; + case kUpb_WireType_Delimited: { + uint64_t size; + ptr = PyUpb_DecodeVarint(ptr, end, &size); + if (!ptr || end - ptr < size) return NULL; + return ptr + size; + } + case kUpb_WireType_StartGroup: + return PyUpb_UnknownFieldSet_SkipGroup(ptr, end, field_number); + case kUpb_WireType_EndGroup: + return NULL; + default: + assert(0); + return NULL; + } +} + +static const char* PyUpb_UnknownFieldSet_SkipGroup(const char* ptr, + const char* end, + int group_number) { + uint32_t end_tag = (group_number << 3) | kUpb_WireType_EndGroup; + while (true) { + if (ptr == end) return NULL; + uint64_t tag; + ptr = PyUpb_DecodeVarint(ptr, end, &tag); + if (!ptr) return NULL; + if (tag == end_tag) return ptr; + ptr = PyUpb_UnknownFieldSet_SkipField(ptr, end, tag); + if (!ptr) return NULL; + } + return ptr; +} + +// For MessageSet the established behavior is for UnknownFieldSet to interpret +// the MessageSet wire format: +// message MessageSet { +// repeated group Item = 1 { +// required int32 type_id = 2; +// required bytes message = 3; +// } +// } +// +// And create unknown fields like: +// UnknownField(type_id, WIRE_TYPE_DELIMITED, message) +// +// For any unknown fields that are unexpected per the wire format defined above, +// we drop them on the floor. + +enum { + kUpb_MessageSet_StartItemTag = (1 << 3) | kUpb_WireType_StartGroup, + kUpb_MessageSet_EndItemTag = (1 << 3) | kUpb_WireType_EndGroup, + kUpb_MessageSet_TypeIdTag = (2 << 3) | kUpb_WireType_Varint, + kUpb_MessageSet_MessageTag = (3 << 3) | kUpb_WireType_Delimited, +}; + +static const char* PyUpb_UnknownFieldSet_BuildMessageSetItem( + PyUpb_UnknownFieldSet* self, const char* ptr, const char* end) { + PyUpb_ModuleState* s = PyUpb_ModuleState_Get(); + int type_id = 0; + PyObject* msg = NULL; + while (true) { + if (ptr == end) goto err; + uint64_t tag; + ptr = PyUpb_DecodeVarint(ptr, end, &tag); + if (!ptr) goto err; + switch (tag) { + case kUpb_MessageSet_EndItemTag: + goto done; + case kUpb_MessageSet_TypeIdTag: { + uint64_t tmp; + ptr = PyUpb_DecodeVarint(ptr, end, &tmp); + if (!ptr) goto err; + if (!type_id) type_id = tmp; + break; + } + case kUpb_MessageSet_MessageTag: { + uint64_t size; + ptr = PyUpb_DecodeVarint(ptr, end, &size); + if (!ptr || end - ptr < size) goto err; + if (!msg) { + msg = PyBytes_FromStringAndSize(ptr, size); + if (!msg) goto err; + } else { + // already saw a message here so deliberately skipping the duplicate + } + ptr += size; + break; + } + default: + ptr = PyUpb_UnknownFieldSet_SkipField(ptr, end, tag); + if (!ptr) goto err; + } + } + +done: + if (type_id && msg) { + PyObject* field = PyObject_CallFunction( + s->unknown_field_type, "iiO", type_id, kUpb_WireType_Delimited, msg); + if (!field) goto err; + PyList_Append(self->fields, field); + Py_DECREF(field); + } + Py_XDECREF(msg); + return ptr; + +err: + Py_XDECREF(msg); + return NULL; +} + +static const char* PyUpb_UnknownFieldSet_BuildMessageSet( + PyUpb_UnknownFieldSet* self, const char* ptr, const char* end) { + self->fields = PyList_New(0); + while (ptr < end) { + uint64_t tag; + ptr = PyUpb_DecodeVarint(ptr, end, &tag); + if (!ptr) goto err; + if (tag == kUpb_MessageSet_StartItemTag) { + ptr = PyUpb_UnknownFieldSet_BuildMessageSetItem(self, ptr, end); + } else { + ptr = PyUpb_UnknownFieldSet_SkipField(ptr, end, tag); + } + if (!ptr) goto err; + } + return ptr; + +err: + Py_DECREF(self->fields); + self->fields = NULL; + return NULL; +} + +static const char* PyUpb_UnknownFieldSet_Build(PyUpb_UnknownFieldSet* self, + const char* ptr, const char* end, + int group_number); + +static const char* PyUpb_UnknownFieldSet_BuildValue( + PyUpb_UnknownFieldSet* self, const char* ptr, const char* end, + int field_number, int wire_type, int group_number, PyObject** data) { + switch (wire_type) { + case kUpb_WireType_Varint: { + uint64_t val; + ptr = PyUpb_DecodeVarint(ptr, end, &val); + if (!ptr) return NULL; + *data = PyLong_FromUnsignedLongLong(val); + return ptr; + } + case kUpb_WireType_64Bit: { + if (end - ptr < 8) return NULL; + uint64_t val; + memcpy(&val, ptr, 8); + *data = PyLong_FromUnsignedLongLong(val); + return ptr + 8; + } + case kUpb_WireType_32Bit: { + if (end - ptr < 4) return NULL; + uint32_t val; + memcpy(&val, ptr, 4); + *data = PyLong_FromUnsignedLongLong(val); + return ptr + 4; + } + case kUpb_WireType_Delimited: { + uint64_t size; + ptr = PyUpb_DecodeVarint(ptr, end, &size); + if (!ptr || end - ptr < size) return NULL; + *data = PyBytes_FromStringAndSize(ptr, size); + return ptr + size; + } + case kUpb_WireType_StartGroup: { + PyUpb_UnknownFieldSet* sub = PyUpb_UnknownFieldSet_NewBare(); + if (!sub) return NULL; + *data = &sub->ob_base; + return PyUpb_UnknownFieldSet_Build(sub, ptr, end, field_number); + } + default: + assert(0); + *data = NULL; + return NULL; + } +} + +// For non-MessageSet we just build the unknown fields exactly as they exist on +// the wire. +static const char* PyUpb_UnknownFieldSet_Build(PyUpb_UnknownFieldSet* self, + const char* ptr, const char* end, + int group_number) { + PyUpb_ModuleState* s = PyUpb_ModuleState_Get(); + self->fields = PyList_New(0); + while (ptr < end) { + uint64_t tag; + ptr = PyUpb_DecodeVarint(ptr, end, &tag); + if (!ptr) goto err; + PyObject* data = NULL; + int field_number = tag >> 3; + int wire_type = tag & 7; + if (wire_type == kUpb_WireType_EndGroup) { + if (field_number != group_number) return NULL; + return ptr; + } + ptr = PyUpb_UnknownFieldSet_BuildValue(self, ptr, end, field_number, + wire_type, group_number, &data); + if (!ptr) { + Py_XDECREF(data); + goto err; + } + assert(data); + PyObject* field = PyObject_CallFunction(s->unknown_field_type, "iiN", + field_number, wire_type, data); + PyList_Append(self->fields, field); + Py_DECREF(field); + } + return ptr; + +err: + Py_DECREF(self->fields); + self->fields = NULL; + return NULL; +} + +static PyObject* PyUpb_UnknownFieldSet_New(PyTypeObject* type, PyObject* args, + PyObject* kwargs) { + char* kwlist[] = {"message", 0}; + PyObject* py_msg = NULL; + + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &py_msg)) { + return NULL; + } + + if (!PyUpb_Message_Verify(py_msg)) return NULL; + PyUpb_UnknownFieldSet* self = PyUpb_UnknownFieldSet_NewBare(); + upb_Message* msg = PyUpb_Message_GetIfReified(py_msg); + if (!msg) return &self->ob_base; + + size_t size; + const char* ptr = upb_Message_GetUnknown(msg, &size); + if (size == 0) return &self->ob_base; + + const char* end = ptr + size; + const upb_MessageDef* msgdef = PyUpb_Message_GetMsgdef(py_msg); + + bool ok; + if (upb_MessageDef_IsMessageSet(msgdef)) { + ok = PyUpb_UnknownFieldSet_BuildMessageSet(self, ptr, end) == end; + } else { + ok = PyUpb_UnknownFieldSet_Build(self, ptr, end, -1) == end; + } + + if (!ok) { + Py_DECREF(&self->ob_base); + return NULL; + } + + return &self->ob_base; +} + +static Py_ssize_t PyUpb_UnknownFieldSet_Length(PyObject* _self) { + PyUpb_UnknownFieldSet* self = (PyUpb_UnknownFieldSet*)_self; + return self->fields ? PyObject_Length(self->fields) : 0; +} + +static PyObject* PyUpb_UnknownFieldSet_GetItem(PyObject* _self, + Py_ssize_t index) { + PyUpb_UnknownFieldSet* self = (PyUpb_UnknownFieldSet*)_self; + if (!self->fields) { + PyErr_Format(PyExc_IndexError, "list index (%zd) out of range", index); + return NULL; + } + PyObject* ret = PyList_GetItem(self->fields, index); + if (ret) Py_INCREF(ret); + return ret; +} + +static PyType_Slot PyUpb_UnknownFieldSet_Slots[] = { + {Py_tp_new, &PyUpb_UnknownFieldSet_New}, + {Py_tp_dealloc, &PyUpb_UnknownFieldSet_Dealloc}, + {Py_sq_length, PyUpb_UnknownFieldSet_Length}, + {Py_sq_item, PyUpb_UnknownFieldSet_GetItem}, + {Py_tp_hash, PyObject_HashNotImplemented}, + {0, NULL}, +}; + +static PyType_Spec PyUpb_UnknownFieldSet_Spec = { + PYUPB_MODULE_NAME ".UnknownFieldSet", // tp_name + sizeof(PyUpb_UnknownFieldSet), // tp_basicsize + 0, // tp_itemsize + Py_TPFLAGS_DEFAULT, // tp_flags + PyUpb_UnknownFieldSet_Slots, +}; + +// ----------------------------------------------------------------------------- +// Top Level +// ----------------------------------------------------------------------------- + +PyObject* PyUpb_UnknownFieldSet_CreateNamedTuple(void) { + PyObject* mod = NULL; + PyObject* namedtuple = NULL; + PyObject* ret = NULL; + + mod = PyImport_ImportModule("collections"); + if (!mod) goto done; + namedtuple = PyObject_GetAttrString(mod, "namedtuple"); + if (!namedtuple) goto done; + ret = PyObject_CallFunction(namedtuple, "s[sss]", "PyUnknownField", + "field_number", "wire_type", "data"); + +done: + Py_XDECREF(mod); + Py_XDECREF(namedtuple); + return ret; +} + +bool PyUpb_UnknownFields_Init(PyObject* m) { + PyUpb_ModuleState* s = PyUpb_ModuleState_GetFromModule(m); + + s->unknown_fields_type = PyUpb_AddClass(m, &PyUpb_UnknownFieldSet_Spec); + s->unknown_field_type = PyUpb_UnknownFieldSet_CreateNamedTuple(); + + return s->unknown_fields_type && s->unknown_field_type; +} diff --git a/third_party/upb/python/api_implementation.c b/third_party/upb/python/unknown_fields.h similarity index 77% rename from third_party/upb/python/api_implementation.c rename to third_party/upb/python/unknown_fields.h index 9f96b936d3b..e78c830bbb6 100644 --- a/third_party/upb/python/api_implementation.c +++ b/third_party/upb/python/unknown_fields.h @@ -25,26 +25,15 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include +#ifndef PYUPB_UNKNOWN_FIELDS_H__ +#define PYUPB_UNKNOWN_FIELDS_H__ -static struct PyModuleDef module_def = { - PyModuleDef_HEAD_INIT, - "google.protobuf.internal._api_implementation", - "Protobuf Module", - -1, - NULL, - NULL, - NULL, - NULL, - NULL}; +#include -PyMODINIT_FUNC PyInit__api_implementation(void) { - PyObject* module = PyModule_Create(&module_def); +#include "python/python_api.h" - if (PyModule_AddIntConstant(module, "api_version", 2)) { - Py_DECREF(module); - return NULL; - } +PyObject* PyUpb_UnknownFields_New(PyObject* msg); - return module; -} +bool PyUpb_UnknownFields_Init(PyObject* m); + +#endif // PYUPB_UNKNOWN_FIELDS_H__ diff --git a/third_party/upb/third_party/utf8_range/utf8_range.h b/third_party/upb/third_party/utf8_range/utf8_range.h index d426608cd42..3695587d5ee 100644 --- a/third_party/upb/third_party/utf8_range/utf8_range.h +++ b/third_party/upb/third_party/utf8_range/utf8_range.h @@ -1,5 +1,5 @@ -#if 0 +#if (defined(__ARM_NEON) && defined(__aarch64__)) || defined(__SSE4_1__) int utf8_range2(const unsigned char* data, int len); #else int utf8_naive(const unsigned char* data, int len); diff --git a/third_party/upb/upb/arena.c b/third_party/upb/upb/arena.c new file mode 100644 index 00000000000..3c872698cd6 --- /dev/null +++ b/third_party/upb/upb/arena.c @@ -0,0 +1,277 @@ +/* + * 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/arena.h" + +#include + +#include "upb/internal/upb.h" + +// Must be last. +#include "upb/port_def.inc" + +/* upb_alloc ******************************************************************/ + +static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, + size_t size) { + UPB_UNUSED(alloc); + UPB_UNUSED(oldsize); + if (size == 0) { + free(ptr); + return NULL; + } else { + return realloc(ptr, size); + } +} + +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 ******************************************************************/ + +struct mem_block { + struct mem_block* next; + uint32_t size; + uint32_t cleanups; + /* Data follows. */ +}; + +typedef struct cleanup_ent { + upb_CleanupFunc* cleanup; + void* ud; +} cleanup_ent; + +static const size_t memblock_reserve = + UPB_ALIGN_UP(sizeof(mem_block), UPB_MALLOC_ALIGN); + +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; + a->parent = next->parent; + a = next; + } + return a; +} + +static void upb_Arena_addblock(upb_Arena* a, upb_Arena* root, void* ptr, + size_t size) { + mem_block* block = ptr; + + /* The block is for arena |a|, but should appear in the freelist of |root|. */ + block->next = root->freelist; + block->size = (uint32_t)size; + block->cleanups = 0; + root->freelist = block; + a->last_size = block->size; + if (!root->freelist_tail) root->freelist_tail = block; + + a->head.ptr = UPB_PTR_AT(block, memblock_reserve, char); + a->head.end = UPB_PTR_AT(block, size, char); + 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); + size_t block_size = UPB_MAX(size, a->last_size * 2) + memblock_reserve; + mem_block* block = upb_malloc(root->block_alloc, block_size); + + if (!block) return false; + 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); +} + +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); +} + +/* 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; + + /* We need to malloc the initial block. */ + n = first_block_overhead + 256; + if (!alloc || !(mem = upb_malloc(alloc, n))) { + return NULL; + } + + a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena); + n -= sizeof(*a); + + 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); + + return 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, UPB_MALLOC_ALIGN); + 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)); + + if (UPB_UNLIKELY(n < sizeof(upb_Arena))) { + return arena_initslow(mem, n, alloc); + } + + a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena); + + a->head.alloc.func = &upb_Arena_doalloc; + a->block_alloc = alloc; + a->parent = a; + a->refcount = 1; + a->last_size = UPB_MAX(128, n); + a->head.ptr = mem; + a->head.end = UPB_PTR_AT(mem, n - sizeof(*a), char); + a->freelist = NULL; + a->cleanup_metadata = upb_cleanup_metadata(NULL, true); + + return a; +} + +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; + + if (block->cleanups > 0) { + cleanup_ent* end = UPB_PTR_AT(block, block->size, void); + cleanup_ent* ptr = end - block->cleanups; + + for (; ptr < end; ptr++) { + ptr->cleanup(ptr->ud); + } + } + + upb_free(a->block_alloc, block); + block = next; + } +} + +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_CleanupFunc* func) { + cleanup_ent* ent; + uint32_t* cleanups = upb_cleanup_pointer(a->cleanup_metadata); + + 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; + (*cleanups)++; + UPB_UNPOISON_MEMORY_REGION(ent, sizeof(cleanup_ent)); + + ent->cleanup = func; + ent->ud = ud; + + return true; +} + +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. */ + + /* 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; + r1 = r2; + r2 = tmp; + } + + /* r1 takes over r2's freelist and refcount. */ + r1->refcount += r2->refcount; + if (r2->freelist_tail) { + UPB_ASSERT(r2->freelist_tail->next == NULL); + r2->freelist_tail->next = r1->freelist; + r1->freelist = r2->freelist; + } + r2->parent = r1; + return true; +} diff --git a/third_party/upb/upb/arena.h b/third_party/upb/upb/arena.h new file mode 100644 index 00000000000..0c4fd1b83c0 --- /dev/null +++ b/third_party/upb/upb/arena.h @@ -0,0 +1,225 @@ +/* + * 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_ARENA_H_ +#define UPB_ARENA_H_ + +#include +#include +#include +#include + +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +/** upb_alloc *****************************************************************/ + +/* A upb_alloc is a possibly-stateful allocator object. + * + * It could either be an arena allocator (which doesn't require individual + * free() calls) or a regular malloc() (which does). The client must therefore + * free memory unless it knows that the allocator is an arena allocator. */ + +struct upb_alloc; +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, + size_t size); + +struct upb_alloc { + upb_alloc_func* func; +}; + +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, + size_t size) { + UPB_ASSERT(alloc); + return alloc->func(alloc, ptr, oldsize, size); +} + +UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) { + assert(alloc); + alloc->func(alloc, ptr, 0, 0); +} + +/* The global allocator used by upb. Uses the standard malloc()/free(). */ + +extern upb_alloc upb_alloc_global; + +/* Functions that hard-code the global malloc. + * + * 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) { + return upb_malloc(&upb_alloc_global, 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_Arena ******************************************************************/ + +/* 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. + * + * 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_CleanupFunc(void* ud); + +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! + * TODO(haberman): remove once handlers are gone. */ + upb_alloc alloc; + + char *ptr, *end; +} _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_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 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_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); + + h->ptr += size; + +#if UPB_ASAN + { + size_t guard_size = 32; + if (_upb_ArenaHas(a) >= guard_size) { + h->ptr += guard_size; + } else { + h->ptr = h->end; + } + } +#endif + + return ret; +} + +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) { + _upb_ArenaHead* h = (_upb_ArenaHead*)a; + oldsize = UPB_ALIGN_MALLOC(oldsize); + size = UPB_ALIGN_MALLOC(size); + bool is_most_recent_alloc = (uintptr_t)ptr + oldsize == (uintptr_t)h->ptr; + + if (is_most_recent_alloc) { + ptrdiff_t diff = size - oldsize; + if ((ptrdiff_t)_upb_ArenaHas(a) >= diff) { + h->ptr += diff; + return ptr; + } + } else if (size <= oldsize) { + return ptr; + } + + void* ret = upb_Arena_Malloc(a, size); + + if (ret && oldsize > 0) { + 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); +} + +#include "upb/port_undef.inc" + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* UPB_ARENA_H_ */ diff --git a/third_party/upb/upb/array.c b/third_party/upb/upb/array.c new file mode 100644 index 00000000000..b4cdc49924e --- /dev/null +++ b/third_party/upb/upb/array.c @@ -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. + */ + +#include "upb/array.h" + +#include + +#include "upb/internal/table.h" +#include "upb/msg.h" +#include "upb/port_def.inc" + +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_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; } + +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); + memcpy(&ret, data + (i << lg2), 1 << lg2); + return ret; +} + +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_MessageValue val, upb_Arena* arena) { + if (!upb_Array_Resize(arr, arr->len + 1, arena)) { + return false; + } + upb_Array_Set(arr, arr->len - 1, val); + return true; +} + +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); +} + +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; +} + +/* + * 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; +} + +bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) { + return _upb_Array_Resize(arr, size, arena); +} diff --git a/third_party/upb/upb/array.h b/third_party/upb/upb/array.h new file mode 100644 index 00000000000..0715d58430a --- /dev/null +++ b/third_party/upb/upb/array.h @@ -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. + */ + +#ifndef UPB_ARRAY_H_ +#define UPB_ARRAY_H_ + +#include "google/protobuf/descriptor.upb.h" +#include "upb/message_value.h" + +// Must be last. +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Creates a new array on the given arena that holds elements of this 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); + +/* Returns the given element, which must be within the array's current size. */ +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_MessageValue val); + +/* Appends an element to the array. Returns false on allocation failure. */ +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); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* UPB_ARRAY_H_ */ diff --git a/third_party/upb/upb/bindings/lua/BUILD b/third_party/upb/upb/bindings/lua/BUILD.bazel similarity index 98% rename from third_party/upb/upb/bindings/lua/BUILD rename to third_party/upb/upb/bindings/lua/BUILD.bazel index 9bb14f5ae28..d5ca32dbf6a 100644 --- a/third_party/upb/upb/bindings/lua/BUILD +++ b/third_party/upb/upb/bindings/lua/BUILD.bazel @@ -83,8 +83,8 @@ cc_test( "//: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", + "@com_google_protobuf//conformance:conformance_proto", ], linkstatic = 1, deps = [ diff --git a/third_party/upb/upb/bindings/lua/def.c b/third_party/upb/upb/bindings/lua/def.c index 132116719a9..602dbaf9a47 100644 --- a/third_party/upb/upb/bindings/lua/def.c +++ b/third_party/upb/upb/bindings/lua/def.c @@ -42,7 +42,7 @@ #define LUPB_FILEDEF "lupb.filedef" #define LUPB_MSGDEF "lupb.msgdef" #define LUPB_ONEOFDEF "lupb.oneof" -#define LUPB_SYMTAB "lupb.symtab" +#define LUPB_SYMTAB "lupb.defpool" #define LUPB_OBJCACHE "lupb.objcache" static void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def, @@ -51,7 +51,7 @@ static void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def, /* lupb_wrapper ***************************************************************/ /* Wrappers around upb def objects. The userval contains a reference to the - * symtab. */ + * defpool. */ #define LUPB_SYMTAB_INDEX 1 @@ -65,19 +65,19 @@ static const void* lupb_wrapper_check(lua_State* L, int narg, return w->def; } -static void lupb_wrapper_pushsymtab(lua_State* L, int narg) { +static void lupb_wrapper_pushdefpool(lua_State* L, int narg) { lua_getiuservalue(L, narg, LUPB_SYMTAB_INDEX); } /* lupb_wrapper_pushwrapper() * * 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. */ + * and the given |type|. The new wrapper will be part of the same defpool. */ static void lupb_wrapper_pushwrapper(lua_State* L, int narg, const void* def, const char* type) { - lupb_wrapper_pushsymtab(L, narg); + lupb_wrapper_pushdefpool(L, narg); lupb_DefPool_pushwrapper(L, -1, def, type); - lua_replace(L, -2); /* Remove symtab from stack. */ + lua_replace(L, -2); /* Remove defpool from stack. */ } /* lupb_MessageDef_pushsubmsgdef() @@ -337,8 +337,8 @@ static int lupb_MessageDef_OneofCount(lua_State* L) { 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_DefPool* symtab = lupb_DefPool_check(L, -1); + lupb_wrapper_pushdefpool(L, msgdef); + upb_DefPool* defpool = lupb_DefPool_check(L, -1); lua_pop(L, 1); /* Construct full package.Message.SubMessage name. */ @@ -350,7 +350,7 @@ static bool lupb_MessageDef_pushnested(lua_State* L, int msgdef, int name) { /* Try lookup. */ const upb_MessageDef* nested = - upb_DefPool_FindMessageByName(symtab, nested_name); + upb_DefPool_FindMessageByName(defpool, nested_name); if (!nested) return false; lupb_wrapper_pushwrapper(L, msgdef, nested, LUPB_MSGDEF); return true; @@ -671,8 +671,8 @@ static int lupb_FileDef_Package(lua_State* L) { 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); + const upb_DefPool* defpool = upb_FileDef_Pool(f); + lupb_wrapper_pushwrapper(L, 1, defpool, LUPB_SYMTAB); return 1; } @@ -691,30 +691,30 @@ static const struct luaL_Reg lupb_FileDef_m[] = { {"msgcount", lupb_FileDef_msgcount}, {"name", lupb_FileDef_Name}, {"package", lupb_FileDef_Package}, - {"symtab", lupb_FileDef_Pool}, + {"defpool", lupb_FileDef_Pool}, {"syntax", lupb_FileDef_Syntax}, {NULL, NULL}}; /* lupb_DefPool * ****************************************************************/ -/* The symtab owns all defs. Thus GC-rooting the symtab ensures that all +/* The defpool owns all defs. Thus GC-rooting the defpool ensures that all * underlying defs stay alive. * - * The symtab's userval is a cache of def* -> object. */ + * The defpool's userval is a cache of def* -> object. */ #define LUPB_CACHE_INDEX 1 typedef struct { - upb_DefPool* symtab; + upb_DefPool* defpool; } lupb_DefPool; upb_DefPool* lupb_DefPool_check(lua_State* L, int narg) { - lupb_DefPool* lsymtab = luaL_checkudata(L, narg, LUPB_SYMTAB); - if (!lsymtab->symtab) { + lupb_DefPool* ldefpool = luaL_checkudata(L, narg, LUPB_SYMTAB); + if (!ldefpool->defpool) { luaL_error(L, "called into dead object"); } - return lsymtab->symtab; + return ldefpool->defpool; } void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def, @@ -739,7 +739,7 @@ void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def, w->def = def; lua_replace(L, -2); /* Replace nil */ - /* Set symtab as userval. */ + /* Set defpool as userval. */ lua_pushvalue(L, narg); lua_setiuservalue(L, -2, LUPB_SYMTAB_INDEX); @@ -754,11 +754,12 @@ void lupb_DefPool_pushwrapper(lua_State* L, int narg, const void* def, /* upb_DefPool_New() * * Handles: - * upb.SymbolTable() -> + * upb.DefPool() -> */ static int lupb_DefPool_New(lua_State* L) { - lupb_DefPool* lsymtab = lupb_newuserdata(L, sizeof(*lsymtab), 1, LUPB_SYMTAB); - lsymtab->symtab = upb_DefPool_New(); + lupb_DefPool* ldefpool = + lupb_newuserdata(L, sizeof(*ldefpool), 1, LUPB_SYMTAB); + ldefpool->defpool = upb_DefPool_New(); /* Create our object cache. */ lua_newtable(L); @@ -769,9 +770,9 @@ static int lupb_DefPool_New(lua_State* L) { lua_setfield(L, -2, "__mode"); lua_setmetatable(L, -2); - /* Put the symtab itself in the cache metatable. */ + /* Put the defpool itself in the cache metatable. */ lua_pushvalue(L, -2); - lua_rawsetp(L, -2, lsymtab->symtab); + lua_rawsetp(L, -2, ldefpool->defpool); /* Set the cache as our userval. */ lua_setiuservalue(L, -2, LUPB_CACHE_INDEX); @@ -780,9 +781,9 @@ static int lupb_DefPool_New(lua_State* L) { } 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; + lupb_DefPool* ldefpool = luaL_checkudata(L, 1, LUPB_SYMTAB); + upb_DefPool_Free(ldefpool->defpool); + ldefpool->defpool = NULL; return 0; } @@ -859,7 +860,7 @@ static int lupb_DefPool_FindEnumByNameval(lua_State* L) { } static int lupb_DefPool_tostring(lua_State* L) { - lua_pushfstring(L, ""); + lua_pushfstring(L, ""); return 1; } @@ -884,7 +885,7 @@ static void lupb_setfieldi(lua_State* L, const char* field, int i) { } static const struct luaL_Reg lupbdef_toplevel_m[] = { - {"SymbolTable", lupb_DefPool_New}, {NULL, NULL}}; + {"DefPool", lupb_DefPool_New}, {NULL, NULL}}; void lupb_def_registertypes(lua_State* L) { lupb_setfuncs(L, lupbdef_toplevel_m); diff --git a/third_party/upb/upb/bindings/lua/lua_proto_library.bzl b/third_party/upb/upb/bindings/lua/lua_proto_library.bzl index 3f34fc18a17..24dfdd60471 100644 --- a/third_party/upb/upb/bindings/lua/lua_proto_library.bzl +++ b/third_party/upb/upb/bindings/lua/lua_proto_library.bzl @@ -23,12 +23,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +"""lua_proto_library(): a rule for building Lua protos.""" + load("@bazel_skylib//lib:paths.bzl", "paths") # Generic support code ######################################################### -_is_bazel = not hasattr(native, "genmpm") - 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 @@ -57,7 +57,10 @@ def _generate_output_file(ctx, src, extension): # upb_proto_library / upb_proto_reflection_library shared code ################# -_LuaFiles = provider(fields = ["files"]) +_LuaFilesInfo = provider( + "A set of lua files generated from .proto files", + fields = ["files"], +) def _compile_upb_protos(ctx, proto_info, proto_sources): files = [_generate_output_file(ctx, name, "_pb.lua") for name in proto_sources] @@ -84,9 +87,9 @@ def _lua_proto_rule_impl(ctx): if len(ctx.attr.deps) != 1: fail("only one deps dependency allowed.") dep = ctx.attr.deps[0] - if _LuaFiles not in dep: - fail("proto_library rule must generate _LuaFiles (aspect should have handled this).") - files = dep[_LuaFiles].files + if _LuaFilesInfo not in dep: + fail("proto_library rule must generate _LuaFilesInfo (aspect should have handled this).") + files = dep[_LuaFilesInfo].files return [ DefaultInfo( files = files, @@ -98,8 +101,8 @@ def _lua_proto_library_aspect_impl(target, ctx): proto_info = target[ProtoInfo] files = _compile_upb_protos(ctx, proto_info, proto_info.direct_sources) deps = ctx.rule.attr.deps - transitive = [dep[_LuaFiles].files for dep in deps if _LuaFiles in dep] - return [_LuaFiles(files = depset(direct = files, transitive = transitive))] + transitive = [dep[_LuaFilesInfo].files for dep in deps if _LuaFilesInfo in dep] + return [_LuaFilesInfo(files = depset(direct = files, transitive = transitive))] # lua_proto_library() ########################################################## @@ -117,7 +120,7 @@ _lua_proto_library_aspect = aspect( ), }, implementation = _lua_proto_library_aspect_impl, - provides = [_LuaFiles], + provides = [_LuaFilesInfo], attr_aspects = ["deps"], fragments = ["cpp"], ) diff --git a/third_party/upb/upb/bindings/lua/msg.c b/third_party/upb/upb/bindings/lua/msg.c index a314f4dbee9..5da2765870d 100644 --- a/third_party/upb/upb/bindings/lua/msg.c +++ b/third_party/upb/upb/bindings/lua/msg.c @@ -983,19 +983,17 @@ static int lupb_Encode(lua_State* L) { 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 = lupb_Arena_pushnew(L); + char* buf; size_t size; - char* result; - - arena = lupb_Arena_pushnew(L); - result = upb_Encode(msg, (const void*)layout, options, arena, &size); - - if (!result) { + upb_EncodeStatus status = + upb_Encode(msg, (const void*)layout, options, arena, &buf, &size); + if (status != kUpb_EncodeStatus_Ok) { lua_pushstring(L, "Error encoding protobuf."); return lua_error(L); } - lua_pushlstring(L, result, size); + lua_pushlstring(L, buf, size); return 1; } @@ -1106,8 +1104,8 @@ void lupb_msg_registertypes(lua_State* L) { lupb_setfieldi(L, "TXTENC_SKIPUNKNOWN", UPB_TXTENC_SKIPUNKNOWN); lupb_setfieldi(L, "TXTENC_NOSORT", UPB_TXTENC_NOSORT); - lupb_setfieldi(L, "ENCODE_DETERMINISTIC", kUpb_Encode_Deterministic); - lupb_setfieldi(L, "ENCODE_SKIPUNKNOWN", kUpb_Encode_SkipUnknown); + lupb_setfieldi(L, "ENCODE_DETERMINISTIC", kUpb_EncodeOption_Deterministic); + lupb_setfieldi(L, "ENCODE_SKIPUNKNOWN", kUpb_EncodeOption_SkipUnknown); lupb_setfieldi(L, "JSONENC_EMITDEFAULTS", upb_JsonEncode_EmitDefaults); lupb_setfieldi(L, "JSONENC_PROTONAMES", upb_JsonEncode_UseProtoNames); diff --git a/third_party/upb/upb/bindings/lua/test.proto b/third_party/upb/upb/bindings/lua/test.proto index c7514360160..fafa753cfc1 100644 --- a/third_party/upb/upb/bindings/lua/test.proto +++ b/third_party/upb/upb/bindings/lua/test.proto @@ -3,7 +3,7 @@ syntax = "proto2"; import "google/protobuf/timestamp.proto"; -package upb_test; +package upb_lua_test; message MapTest { map map_string_double = 1; diff --git a/third_party/upb/upb/bindings/lua/test_upb.lua b/third_party/upb/upb/bindings/lua/test_upb.lua index 277a7efc95d..998f3110ab8 100644 --- a/third_party/upb/upb/bindings/lua/test_upb.lua +++ b/third_party/upb/upb/bindings/lua/test_upb.lua @@ -408,7 +408,7 @@ function test_finalizer() end) end) t = { - upb.SymbolTable(), + upb.DefPool(), } end collectgarbage() @@ -666,14 +666,14 @@ function test_unknown() end function test_foo() - local symtab = upb.SymbolTable() + local defpool = upb.DefPool() 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") + defpool:add_set(descriptor) + local FileDescriptorSet = defpool:lookup_msg("google.protobuf.FileDescriptorSet") assert_not_nil(FileDescriptorSet) set = FileDescriptorSet() assert_equal(#set.file, 0) @@ -690,7 +690,7 @@ function test_foo() end function test_descriptor() - local symtab = upb.SymbolTable() + local defpool = upb.DefPool() local file_proto = descriptor.FileDescriptorProto { name = "test.proto", message_type = upb.Array(descriptor.DescriptorProto, { @@ -699,12 +699,12 @@ function test_descriptor() }, }) } - local file = symtab:add_file(upb.encode(file_proto)) - assert_equal(file:symtab(), symtab) + local file = defpool:add_file(upb.encode(file_proto)) + assert_equal(file:defpool(), defpool) end function test_descriptor_error() - local symtab = upb.SymbolTable() + local defpool = upb.DefPool() local file = descriptor.FileDescriptorProto() file.name = "test.proto" file.message_type[1] = descriptor.DescriptorProto{ @@ -713,12 +713,12 @@ function test_descriptor_error() file.message_type[2] = descriptor.DescriptorProto{ name = "BC." } - assert_error(function () symtab:add_file(upb.encode(file)) end) - assert_nil(symtab:lookup_msg("ABC")) + assert_error(function () defpool:add_file(upb.encode(file)) end) + assert_nil(defpool:lookup_msg("ABC")) end function test_duplicate_enumval() - local symtab = upb.SymbolTable() + local defpool = upb.DefPool() local file_proto = descriptor.FileDescriptorProto { name = "test.proto", message_type = upb.Array(descriptor.DescriptorProto, { @@ -738,16 +738,16 @@ function test_duplicate_enumval() }, }) } - assert_error(function () symtab:add_file(upb.encode(file_proto)) end) + assert_error(function () defpool:add_file(upb.encode(file_proto)) end) end function test_duplicate_filename_error() - local symtab = upb.SymbolTable() + local defpool = upb.DefPool() local file = descriptor.FileDescriptorProto() file.name = "test.proto" - symtab:add_file(upb.encode(file)) + defpool:add_file(upb.encode(file)) -- Second add with the same filename fails. - assert_error(function () symtab:add_file(upb.encode(file)) end) + assert_error(function () defpool:add_file(upb.encode(file)) end) end function test_encode_skipunknown() diff --git a/third_party/upb/upb/bindings/lua/upb.lua b/third_party/upb/upb/bindings/lua/upb.lua index e2d4cd1b717..35333097c65 100644 --- a/third_party/upb/upb/bindings/lua/upb.lua +++ b/third_party/upb/upb/bindings/lua/upb.lua @@ -29,7 +29,7 @@ local upb = require("lupb") -upb.generated_pool = upb.SymbolTable() +upb.generated_pool = upb.DefPool() local module_metatable = { __index = function(t, k) diff --git a/third_party/upb/upb/bindings/lua/upbc.cc b/third_party/upb/upb/bindings/lua/upbc.cc index 07939228614..78e1473a7e1 100644 --- a/third_party/upb/upb/bindings/lua/upbc.cc +++ b/third_party/upb/upb/bindings/lua/upbc.cc @@ -23,15 +23,14 @@ // (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 -#include - +#include "google/protobuf/compiler/code_generator.h" +#include "google/protobuf/compiler/plugin.h" +#include "google/protobuf/io/printer.h" +#include "google/protobuf/descriptor.pb.h" +#include "google/protobuf/descriptor.h" #include "absl/strings/str_replace.h" #include "absl/strings/string_view.h" #include "absl/strings/substitute.h" -#include "google/protobuf/compiler/code_generator.h" -#include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" namespace protoc = ::google::protobuf::compiler; namespace protobuf = ::google::protobuf; diff --git a/third_party/upb/python/python.h b/third_party/upb/upb/collections.h similarity index 73% rename from third_party/upb/python/python.h rename to third_party/upb/upb/collections.h index 7eef3e5fe04..81558dc5c96 100644 --- a/third_party/upb/python/python.h +++ b/third_party/upb/upb/collections.h @@ -25,18 +25,12 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PYUPB_PYTHON_H__ -#define PYUPB_PYTHON_H__ +#ifndef UPB_COLLECTIONS_H_ +#define UPB_COLLECTIONS_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 +// TODO(b/232091617): Delete this entire header which currently exists only for +// temporary backwards compatibility. +#include "upb/array.h" +#include "upb/map.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__ +#endif /* UPB_COLLECTIONS_H_ */ diff --git a/third_party/upb/upb/conformance_upb.c b/third_party/upb/upb/conformance_upb.c index b64c112c868..be5ce9c7dc3 100644 --- a/third_party/upb/upb/conformance_upb.c +++ b/third_party/upb/upb/conformance_upb.c @@ -37,8 +37,8 @@ #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 "google/protobuf/test_messages_proto2.upbdefs.h" +#include "google/protobuf/test_messages_proto3.upbdefs.h" #include "upb/decode.h" #include "upb/encode.h" #include "upb/json_decode.h" @@ -102,8 +102,10 @@ bool parse_proto(upb_Message* msg, const upb_MessageDef* m, const ctx* c) { 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) { + char* data; + upb_EncodeStatus status = + upb_Encode(msg, upb_MessageDef_MiniTable(m), 0, c->arena, &data, &len); + if (status == kUpb_EncodeStatus_Ok) { conformance_ConformanceResponse_set_protobuf_payload( c->response, upb_StringView_FromDataAndSize(data, len)); } else { @@ -325,9 +327,9 @@ int main(void) { #ifdef REBUILD_MINITABLES _upb_DefPool_LoadDefInitEx( - symtab, &src_google_protobuf_test_messages_proto2_proto_upbdefinit, true); + symtab, &google_protobuf_test_messages_proto2_proto_upbdefinit, true); _upb_DefPool_LoadDefInitEx( - symtab, &src_google_protobuf_test_messages_proto3_proto_upbdefinit, true); + symtab, &google_protobuf_test_messages_proto3_proto_upbdefinit, true); #else protobuf_test_messages_proto2_TestAllTypesProto2_getmsgdef(symtab); protobuf_test_messages_proto3_TestAllTypesProto3_getmsgdef(symtab); diff --git a/third_party/upb/upb/decode.c b/third_party/upb/upb/decode.c index 2d5bb495254..d3148753133 100644 --- a/third_party/upb/upb/decode.c +++ b/third_party/upb/upb/decode.c @@ -30,9 +30,9 @@ #include #include -#include "upb/decode_internal.h" +#include "upb/internal/decode.h" +#include "upb/internal/upb.h" #include "upb/upb.h" -#include "upb/upb_internal.h" /* Must be last. */ #include "upb/port_def.inc" @@ -93,13 +93,11 @@ static const unsigned FIXED64_OK_MASK = (1 << kUpb_FieldType_Double) | /* Three fake field types for MessageSet. */ #define TYPE_MSGSET_ITEM 19 -#define TYPE_MSGSET_TYPE_ID 20 -#define TYPE_COUNT 20 +#define TYPE_COUNT 19 /* Op: an action to be performed for a wire-type/field-type combination. */ #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 @@ -131,7 +129,6 @@ static const int8_t varint_ops[] = { 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[] = { @@ -156,7 +153,6 @@ static const int8_t delim_ops[] = { 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 */ @@ -266,6 +262,18 @@ static const char* decode_tag(upb_Decoder* d, const char* ptr, uint32_t* val) { } } +UPB_FORCEINLINE +static const char* upb_Decoder_DecodeSize(upb_Decoder* d, const char* ptr, + uint32_t* size) { + uint64_t size64; + ptr = decode_varint64(d, ptr, &size64); + if (size64 >= INT32_MAX || ptr - d->end + (int)size64 > d->limit) { + decode_err(d, kUpb_DecodeStatus_Malformed); + } + *size = size64; + return ptr; +} + static void decode_munge_int32(wireval* val) { if (!_upb_IsLittleEndian()) { /* The next stage will memcpy(dst, &val, 4) */ @@ -300,7 +308,9 @@ 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_Message* msg = _upb_Message_New_inl(subl, &d->arena); + if (!msg) decode_err(d, kUpb_DecodeStatus_OutOfMemory); + return msg; } UPB_NOINLINE @@ -375,7 +385,7 @@ static const char* decode_togroup(upb_Decoder* d, const char* ptr, return decode_group(d, ptr, submsg, subl, field->number); } -static char* encode_varint32(uint32_t val, char* ptr) { +static char* upb_Decoder_EncodeVarint32(uint32_t val, char* ptr) { do { uint8_t byte = val & 0x7fU; val >>= 7; @@ -389,8 +399,8 @@ 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); + end = upb_Decoder_EncodeVarint32(val1, end); + end = upb_Decoder_EncodeVarint32(val2, end); if (!_upb_Message_AddUnknown(msg, buf, end - buf, &d->arena)) { decode_err(d, kUpb_DecodeStatus_OutOfMemory); @@ -643,7 +653,10 @@ static const char* decode_tomap(upb_Decoder* d, const char* ptr, decode_err(d, kUpb_DecodeStatus_OutOfMemory); } } else { - _upb_Map_Set(map, &ent.k, map->key_size, &ent.v, map->val_size, &d->arena); + if (_upb_Map_Insert(map, &ent.k, map->key_size, &ent.v, map->val_size, + &d->arena) == _kUpb_MapInsertStatus_OutOfMemory) { + decode_err(d, kUpb_DecodeStatus_OutOfMemory); + } } return ptr; } @@ -743,25 +756,139 @@ static bool decode_tryfastdispatch(upb_Decoder* 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 char* upb_Decoder_SkipField(upb_Decoder* d, const char* ptr, + uint32_t tag) { + int field_number = tag >> 3; + int wire_type = tag & 7; + switch (wire_type) { + case kUpb_WireType_Varint: { + uint64_t val; + return decode_varint64(d, ptr, &val); + } + case kUpb_WireType_64Bit: + return ptr + 8; + case kUpb_WireType_32Bit: + return ptr + 4; + case kUpb_WireType_Delimited: { + uint32_t size; + ptr = upb_Decoder_DecodeSize(d, ptr, &size); + return ptr + size; + } + case kUpb_WireType_StartGroup: + return decode_group(d, ptr, NULL, NULL, field_number); + default: + decode_err(d, kUpb_DecodeStatus_Malformed); + } +} + +enum { + kStartItemTag = ((1 << 3) | kUpb_WireType_StartGroup), + kEndItemTag = ((1 << 3) | kUpb_WireType_EndGroup), + kTypeIdTag = ((2 << 3) | kUpb_WireType_Varint), + kMessageTag = ((3 << 3) | kUpb_WireType_Delimited), +}; + +static void upb_Decoder_AddKnownMessageSetItem( + upb_Decoder* d, upb_Message* msg, const upb_MiniTable_Extension* item_mt, + const char* data, uint32_t size) { + upb_Message_Extension* ext = + _upb_Message_GetOrCreateExtension(msg, item_mt, &d->arena); + if (UPB_UNLIKELY(!ext)) decode_err(d, kUpb_DecodeStatus_OutOfMemory); + upb_Message* submsg = decode_newsubmsg(d, &ext->ext->sub, &ext->ext->field); + upb_DecodeStatus status = upb_Decode(data, size, submsg, item_mt->sub.submsg, + d->extreg, d->options, &d->arena); + memcpy(&ext->data, &submsg, sizeof(submsg)); + if (status != kUpb_DecodeStatus_Ok) decode_err(d, status); +} + +static void upb_Decoder_AddUnknownMessageSetItem(upb_Decoder* d, + upb_Message* msg, + uint32_t type_id, + const char* message_data, + uint32_t message_size) { + char buf[60]; + char* ptr = buf; + ptr = upb_Decoder_EncodeVarint32(kStartItemTag, ptr); + ptr = upb_Decoder_EncodeVarint32(kTypeIdTag, ptr); + ptr = upb_Decoder_EncodeVarint32(type_id, ptr); + ptr = upb_Decoder_EncodeVarint32(kMessageTag, ptr); + ptr = upb_Decoder_EncodeVarint32(message_size, ptr); + char* split = ptr; + + ptr = upb_Decoder_EncodeVarint32(kEndItemTag, ptr); + char* end = ptr; + + if (!_upb_Message_AddUnknown(msg, buf, split - buf, &d->arena) || + !_upb_Message_AddUnknown(msg, message_data, message_size, &d->arena) || + !_upb_Message_AddUnknown(msg, split, end - split, &d->arena)) { + decode_err(d, kUpb_DecodeStatus_OutOfMemory); + } +} + +static void upb_Decoder_AddMessageSetItem(upb_Decoder* d, upb_Message* msg, + const upb_MiniTable* layout, + uint32_t type_id, const char* data, + uint32_t size) { + const upb_MiniTable_Extension* item_mt = + _upb_extreg_get(d->extreg, layout, type_id); + if (item_mt) { + upb_Decoder_AddKnownMessageSetItem(d, msg, item_mt, data, size); + } else { + upb_Decoder_AddUnknownMessageSetItem(d, msg, type_id, data, size); + } +} + +static const char* upb_Decoder_DecodeMessageSetItem( + upb_Decoder* d, const char* ptr, upb_Message* msg, + const upb_MiniTable* layout) { + uint32_t type_id = 0; + upb_StringView preserved = {NULL, 0}; + typedef enum { + kUpb_HaveId = 1 << 0, + kUpb_HavePayload = 1 << 1, + } StateMask; + StateMask state_mask = 0; + while (!decode_isdone(d, &ptr)) { + uint32_t tag; + ptr = decode_tag(d, ptr, &tag); + switch (tag) { + case kEndItemTag: + return ptr; + case kTypeIdTag: { + uint64_t tmp; + ptr = decode_varint64(d, ptr, &tmp); + if (state_mask & kUpb_HaveId) break; // Ignore dup. + state_mask |= kUpb_HaveId; + type_id = tmp; + if (state_mask & kUpb_HavePayload) { + upb_Decoder_AddMessageSetItem(d, msg, layout, type_id, preserved.data, + preserved.size); + } + break; + } + case kMessageTag: { + uint32_t size; + ptr = upb_Decoder_DecodeSize(d, ptr, &size); + const char* data = ptr; + ptr += size; + if (state_mask & kUpb_HavePayload) break; // Ignore dup. + state_mask |= kUpb_HavePayload; + if (state_mask & kUpb_HaveId) { + upb_Decoder_AddMessageSetItem(d, msg, layout, type_id, data, size); + } else { + // Out of order, we must preserve the payload. + preserved.data = data; + preserved.size = size; + } + break; + } + default: + // We do not preserve unexpected fields inside a message set item. + ptr = upb_Decoder_SkipField(d, ptr, tag); + break; + } + } + decode_err(d, kUpb_DecodeStatus_Malformed); } static const upb_MiniTable_Field* decode_findfield(upb_Decoder* d, @@ -808,26 +935,6 @@ static const upb_MiniTable_Field* decode_findfield(upb_Decoder* d, 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; - } } } @@ -867,14 +974,9 @@ static const char* decode_wireval(upb_Decoder* d, const char* ptr, 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. */ - } + ptr = upb_Decoder_DecodeSize(d, ptr, &val->size); *op = delim_ops[ndx]; - val->size = size; return ptr; } case kUpb_WireType_StartGroup: @@ -905,7 +1007,7 @@ static const char* decode_known(upb_Decoder* d, const char* ptr, const upb_MiniTable_Extension* ext_layout = (const upb_MiniTable_Extension*)field; upb_Message_Extension* ext = - _upb_Message_Getorcreateext(msg, ext_layout, &d->arena); + _upb_Message_GetOrCreateExtension(msg, ext_layout, &d->arena); if (UPB_UNLIKELY(!ext)) return decode_err(d, kUpb_DecodeStatus_OutOfMemory); msg = &ext->data; subs = &ext->ext->sub; @@ -1038,14 +1140,8 @@ static const char* decode_msg(upb_Decoder* d, const char* ptr, upb_Message* msg, ptr = decode_unknown(d, ptr, msg, field_number, wire_type, val); break; case OP_MSGSET_ITEM: - ptr = decode_msgset(d, ptr, msg, layout); - break; - 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; + ptr = upb_Decoder_DecodeMessageSetItem(d, ptr, msg, layout); break; - } } } } diff --git a/third_party/upb/upb/decode.h b/third_party/upb/upb/decode.h index 1fa8131b7da..0c09497feb1 100644 --- a/third_party/upb/upb/decode.h +++ b/third_party/upb/upb/decode.h @@ -32,6 +32,7 @@ #ifndef UPB_DECODE_H_ #define UPB_DECODE_H_ +#include "upb/extension_registry.h" #include "upb/msg.h" /* Must be last. */ diff --git a/third_party/upb/upb/decode_fast.c b/third_party/upb/upb/decode_fast.c index e05bf8e0db9..a02ad0948fc 100644 --- a/third_party/upb/upb/decode_fast.c +++ b/third_party/upb/upb/decode_fast.c @@ -37,7 +37,7 @@ #include "upb/decode_fast.h" -#include "upb/decode_internal.h" +#include "upb/internal/decode.h" /* Must be last. */ #include "upb/port_def.inc" diff --git a/third_party/upb/upb/decode_internal.h b/third_party/upb/upb/decode_internal.h index 11bb9aa095b..fe3cbc7d493 100644 --- a/third_party/upb/upb/decode_internal.h +++ b/third_party/upb/upb/decode_internal.h @@ -25,187 +25,12 @@ * 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 - -#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); -} +// TODO(b/232091617): Delete this entire header which currently exists only for +// temporary backwards compatibility. -#include "upb/port_undef.inc" +#include "upb/internal/decode.h" #endif /* UPB_DECODE_INT_H_ */ diff --git a/third_party/upb/upb/def.c b/third_party/upb/upb/def.c index 140465aab51..6ddc45bbbb2 100644 --- a/third_party/upb/upb/def.c +++ b/third_party/upb/upb/def.c @@ -34,6 +34,7 @@ #include #include "google/protobuf/descriptor.upb.h" +#include "upb/mini_table.h" #include "upb/reflection.h" /* Must be last. */ @@ -648,6 +649,14 @@ bool upb_FieldDef_IsString(const upb_FieldDef* f) { upb_FieldDef_CType(f) == kUpb_CType_Bytes; } +bool upb_FieldDef_IsOptional(const upb_FieldDef* f) { + return upb_FieldDef_Label(f) == kUpb_Label_Optional; +} + +bool upb_FieldDef_IsRequired(const upb_FieldDef* f) { + return upb_FieldDef_Label(f) == kUpb_Label_Required; +} + bool upb_FieldDef_IsRepeated(const upb_FieldDef* f) { return upb_FieldDef_Label(f) == kUpb_Label_Repeated; } @@ -2338,8 +2347,7 @@ static void create_fielddef( } if (google_protobuf_FieldDescriptorProto_has_oneof_index(field_proto)) { - int oneof_index = - google_protobuf_FieldDescriptorProto_oneof_index(field_proto); + uint32_t oneof_index = google_protobuf_FieldDescriptorProto_oneof_index(field_proto); upb_OneofDef* oneof; upb_value v = upb_value_constptr(f); diff --git a/third_party/upb/upb/def.h b/third_party/upb/upb/def.h index a81b0070317..2cb312df1a2 100644 --- a/third_party/upb/upb/def.h +++ b/third_party/upb/upb/def.h @@ -29,7 +29,7 @@ #define UPB_DEF_H_ #include "google/protobuf/descriptor.upb.h" -#include "upb/table_internal.h" +#include "upb/internal/table.h" #include "upb/upb.h" /* Must be last. */ @@ -116,6 +116,8 @@ 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_IsOptional(const upb_FieldDef* f); +bool upb_FieldDef_IsRequired(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); @@ -210,6 +212,11 @@ UPB_INLINE bool upb_MessageDef_IsMapEntry(const upb_MessageDef* m) { return google_protobuf_MessageOptions_map_entry(upb_MessageDef_Options(m)); } +UPB_INLINE bool upb_MessageDef_IsMessageSet(const upb_MessageDef* m) { + return google_protobuf_MessageOptions_message_set_wire_format( + upb_MessageDef_Options(m)); +} + /* Nested entities. */ int upb_MessageDef_NestedMessageCount(const upb_MessageDef* m); int upb_MessageDef_NestedEnumCount(const upb_MessageDef* m); diff --git a/third_party/upb/upb/def.hpp b/third_party/upb/upb/def.hpp index aaf9496226b..49cc5608162 100644 --- a/third_party/upb/upb/def.hpp +++ b/third_party/upb/upb/def.hpp @@ -373,11 +373,11 @@ class FileDefPtr { const upb_FileDef* ptr_; }; -// Non-const methods in upb::SymbolTable are NOT thread-safe. -class SymbolTable { +// Non-const methods in upb::DefPool are NOT thread-safe. +class DefPool { public: - SymbolTable() : ptr_(upb_DefPool_New(), upb_DefPool_Free) {} - explicit SymbolTable(upb_DefPool* s) : ptr_(s, upb_DefPool_Free) {} + DefPool() : ptr_(upb_DefPool_New(), upb_DefPool_Free) {} + explicit DefPool(upb_DefPool* s) : ptr_(s, upb_DefPool_Free) {} const upb_DefPool* ptr() const { return ptr_.get(); } upb_DefPool* ptr() { return ptr_.get(); } @@ -409,6 +409,9 @@ class SymbolTable { std::unique_ptr ptr_; }; +// TODO(b/236632406): This typedef is deprecated. Delete it. +using SymbolTable = DefPool; + inline FileDefPtr MessageDefPtr::file() const { return FileDefPtr(upb_MessageDef_File(ptr_)); } diff --git a/third_party/upb/upb/encode.c b/third_party/upb/upb/encode.c index ff84275ffb5..048ecd2396a 100644 --- a/third_party/upb/upb/encode.c +++ b/third_party/upb/upb/encode.c @@ -32,6 +32,7 @@ #include #include +#include "upb/extension_registry.h" #include "upb/msg_internal.h" #include "upb/upb.h" @@ -76,7 +77,9 @@ 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_EncodeStatus s) { + UPB_LONGJMP(e->err, s); +} UPB_NOINLINE static void encode_growbuffer(upb_encstate* e, size_t bytes) { @@ -84,7 +87,7 @@ static void encode_growbuffer(upb_encstate* e, size_t bytes) { 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); - if (!new_buf) encode_err(e); + if (!new_buf) encode_err(e, kUpb_EncodeStatus_OutOfMemory); /* We want previous data at the end, realloc() put it at the beginning. */ if (old_size > 0) { @@ -255,7 +258,7 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem, if (submsg == NULL) { return; } - if (--e->depth == 0) encode_err(e); + if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); encode_tag(e, f->number, kUpb_WireType_EndGroup); encode_message(e, submsg, subm, &size); wire_type = kUpb_WireType_StartGroup; @@ -269,7 +272,7 @@ static void encode_scalar(upb_encstate* e, const void* _field_mem, if (submsg == NULL) { return; } - if (--e->depth == 0) encode_err(e); + if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); encode_message(e, submsg, subm, &size); encode_varint(e, size); wire_type = kUpb_WireType_Delimited; @@ -355,7 +358,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, 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); + if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); do { size_t size; ptr--; @@ -370,7 +373,7 @@ static void encode_array(upb_encstate* e, const upb_Message* msg, 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); + if (--e->depth == 0) encode_err(e, kUpb_EncodeStatus_MaxDepthExceeded); do { size_t size; ptr--; @@ -413,7 +416,7 @@ static void encode_map(upb_encstate* e, const upb_Message* msg, if (map == NULL) return; - if (e->options & kUpb_Encode_Deterministic) { + if (e->options & kUpb_EncodeOption_Deterministic) { _upb_sortedmap sorted; _upb_mapsorter_pushmap(&e->sorter, layout->fields[0].descriptortype, map, &sorted); @@ -520,16 +523,16 @@ 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; - if ((e->options & kUpb_Encode_CheckRequired) && m->required_count) { + if ((e->options & kUpb_EncodeOption_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); + encode_err(e, kUpb_EncodeStatus_MissingRequired); } } - if ((e->options & kUpb_Encode_SkipUnknown) == 0) { + if ((e->options & kUpb_EncodeOption_SkipUnknown) == 0) { size_t unknown_size; const char* unknown = upb_Message_GetUnknown(msg, &unknown_size); @@ -570,8 +573,9 @@ static void encode_message(upb_encstate* e, const upb_Message* msg, *size = (e->limit - e->ptr) - pre_len; } -char* upb_Encode(const void* msg, const upb_MiniTable* l, int options, - upb_Arena* arena, size_t* size) { +upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, + int options, upb_Arena* arena, char** buf, + size_t* size) { upb_encstate e; unsigned depth = (unsigned)options >> 16; @@ -582,23 +586,28 @@ char* upb_Encode(const void* msg, const upb_MiniTable* l, int options, e.depth = depth ? depth : 64; e.options = options; _upb_mapsorter_init(&e.sorter); - char* ret = NULL; - if (UPB_SETJMP(e.err)) { - *size = 0; - ret = NULL; - } else { + upb_EncodeStatus status = UPB_SETJMP(e.err); + + // Unfortunately we must continue to perform hackery here because there are + // code paths which blindly copy the returned pointer without bothering to + // check for errors until much later (b/235839510). So we still set *buf to + // NULL on error and we still set it to non-NULL on a successful empty result. + if (status == kUpb_EncodeStatus_Ok) { encode_message(&e, msg, l, size); *size = e.limit - e.ptr; if (*size == 0) { static char ch; - ret = &ch; + *buf = &ch; } else { UPB_ASSERT(e.ptr); - ret = e.ptr; + *buf = e.ptr; } + } else { + *buf = NULL; + *size = 0; } _upb_mapsorter_destroy(&e.sorter); - return ret; + return status; } diff --git a/third_party/upb/upb/encode.h b/third_party/upb/upb/encode.h index 906b6f0c357..791d84a74c7 100644 --- a/third_party/upb/upb/encode.h +++ b/third_party/upb/upb/encode.h @@ -26,7 +26,7 @@ */ /* - * upb_Encode: parsing into a upb_Message using a upb_MiniTable. + * upb_Encode: parsing from a upb_Message using a upb_MiniTable. */ #ifndef UPB_ENCODE_H_ @@ -48,19 +48,29 @@ enum { * * If your proto contains maps, the encoder will need to malloc()/free() * memory during encode. */ - kUpb_Encode_Deterministic = 1, + kUpb_EncodeOption_Deterministic = 1, /* When set, unknown fields are not printed. */ - kUpb_Encode_SkipUnknown = 2, + kUpb_EncodeOption_SkipUnknown = 2, /* When set, the encode will fail if any required fields are missing. */ - kUpb_Encode_CheckRequired = 4, + kUpb_EncodeOption_CheckRequired = 4, }; #define UPB_ENCODE_MAXDEPTH(depth) ((depth) << 16) -char* upb_Encode(const void* msg, const upb_MiniTable* l, int options, - upb_Arena* arena, size_t* size); +typedef enum { + kUpb_EncodeStatus_Ok = 0, + kUpb_EncodeStatus_OutOfMemory = 1, // Arena alloc failed + kUpb_EncodeStatus_MaxDepthExceeded = 2, // Exceeded UPB_ENCODE_MAXDEPTH + + // kUpb_EncodeOption_CheckRequired failed but the parse otherwise succeeded. + kUpb_EncodeStatus_MissingRequired = 3, +} upb_EncodeStatus; + +upb_EncodeStatus upb_Encode(const void* msg, const upb_MiniTable* l, + int options, upb_Arena* arena, char** buf, + size_t* size); #include "upb/port_undef.inc" diff --git a/third_party/upb/upb/extension_registry.c b/third_party/upb/upb/extension_registry.c new file mode 100644 index 00000000000..921cf227dde --- /dev/null +++ b/third_party/upb/upb/extension_registry.c @@ -0,0 +1,93 @@ +/* + * 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/extension_registry.h" + +#include "upb/internal/table.h" +#include "upb/msg.h" +#include "upb/msg_internal.h" + +// Must be last. +#include "upb/port_def.inc" + +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/third_party/upb/upb/extension_registry.h b/third_party/upb/upb/extension_registry.h new file mode 100644 index 00000000000..0e0a4440ca6 --- /dev/null +++ b/third_party/upb/upb/extension_registry.h @@ -0,0 +1,84 @@ +/* + * 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_EXTENSION_REGISTRY_H_ +#define UPB_EXTENSION_REGISTRY_H_ + +#include + +#include "upb/upb.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* 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. + * + * 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. + * + * 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. + */ + +struct upb_ExtensionRegistry; +typedef struct upb_ExtensionRegistry upb_ExtensionRegistry; + +/* 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" */ +#endif + +#endif /* UPB_EXTENSION_REGISTRY_H_ */ diff --git a/third_party/upb/upb/internal/decode.h b/third_party/upb/upb/internal/decode.h new file mode 100644 index 00000000000..708874c9c73 --- /dev/null +++ b/third_party/upb/upb/internal/decode.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_INTERNAL_DECODE_H_ +#define UPB_INTERNAL_DECODE_H_ + +#include + +#include "upb/decode.h" +#include "upb/internal/upb.h" +#include "upb/msg_internal.h" +#include "third_party/utf8_range/utf8_range.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_INTERNAL_DECODE_H_ */ diff --git a/third_party/upb/upb/internal/mini_table_accessors.h b/third_party/upb/upb/internal/mini_table_accessors.h new file mode 100644 index 00000000000..23f694baee3 --- /dev/null +++ b/third_party/upb/upb/internal/mini_table_accessors.h @@ -0,0 +1,59 @@ +/* + * 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_INTERNAL_MINI_TABLE_ACCESSORS_H_ +#define UPB_INTERNAL_MINI_TABLE_ACCESSORS_H_ + +#include "upb/msg_internal.h" + +// Must be last. +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +UPB_INLINE bool _upb_MiniTable_Field_InOneOf(const upb_MiniTable_Field* field) { + return field->presence < 0; +} + +UPB_INLINE void _upb_MiniTable_SetPresence(upb_Message* msg, + const upb_MiniTable_Field* field) { + if (field->presence > 0) { + _upb_sethas_field(msg, field); + } else if (_upb_MiniTable_Field_InOneOf(field)) { + *_upb_oneofcase_field(msg, field) = field->number; + } +} + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif // UPB_INTERNAL_MINI_TABLE_ACCESSORS_H_ diff --git a/third_party/upb/upb/internal/table.h b/third_party/upb/upb/internal/table.h new file mode 100644 index 00000000000..bc647be83f1 --- /dev/null +++ b/third_party/upb/upb/internal/table.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_INTERNAL_TABLE_H_ +#define UPB_INTERNAL_TABLE_H_ + +#include +#include + +#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 strtables, the key is not required + * to 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_INTERNAL_TABLE_H_ */ diff --git a/third_party/upb/upb/internal/upb.h b/third_party/upb/upb/internal/upb.h new file mode 100644 index 00000000000..cdc8bfc228b --- /dev/null +++ b/third_party/upb/upb/internal/upb.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_INTERNAL_UPB_H_ +#define UPB_INTERNAL_UPB_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_INTERNAL_UPB_H_ */ diff --git a/third_party/upb/upb/internal/vsnprintf_compat.h b/third_party/upb/upb/internal/vsnprintf_compat.h new file mode 100644 index 00000000000..a9d84bb6feb --- /dev/null +++ b/third_party/upb/upb/internal/vsnprintf_compat.h @@ -0,0 +1,52 @@ +/* + * 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_INTERNAL_VSNPRINTF_COMPAT_H_ +#define UPB_INTERNAL_VSNPRINTF_COMPAT_H_ + +#include + +// Must be last. +#include "upb/port_def.inc" + +UPB_INLINE int _upb_vsnprintf(char* buf, size_t size, const char* fmt, + va_list ap) { +#if defined(__MINGW64__) || defined(__MINGW32__) || defined(_MSC_VER) + // The msvc runtime has a non-conforming vsnprintf() that requires the + // following compatibility code to become conformant. + int n = -1; + if (size != 0) n = _vsnprintf_s(buf, size, _TRUNCATE, fmt, ap); + if (n == -1) n = _vscprintf(fmt, ap); + return n; +#else + return vsnprintf(buf, size, fmt, ap); +#endif +} + +#include "upb/port_undef.inc" + +#endif // UPB_INTERNAL_VSNPRINTF_COMPAT_H_ diff --git a/third_party/upb/upb/json_decode.c b/third_party/upb/upb/json_decode.c index c4698f03bf6..4f79294ef88 100644 --- a/third_party/upb/upb/json_decode.c +++ b/third_party/upb/upb/json_decode.c @@ -1431,8 +1431,11 @@ static void jsondec_any(jsondec* d, upb_Message* msg, const upb_MessageDef* m) { jsondec_objend(d); - encoded.str_val.data = upb_Encode(any_msg, upb_MessageDef_MiniTable(any_m), 0, - d->arena, &encoded.str_val.size); + upb_EncodeStatus status = + upb_Encode(any_msg, upb_MessageDef_MiniTable(any_m), 0, d->arena, + (char**)&encoded.str_val.data, &encoded.str_val.size); + // TODO(b/235839510): We should fail gracefully here on a bad return status. + UPB_ASSERT(status == kUpb_EncodeStatus_Ok); upb_Message_Set(msg, value_f, encoded, d->arena); } diff --git a/third_party/upb/upb/json_encode.c b/third_party/upb/upb/json_encode.c index 9668a426d2c..e13c0f771d6 100644 --- a/third_party/upb/upb/json_encode.c +++ b/third_party/upb/upb/json_encode.c @@ -37,8 +37,9 @@ #include #include "upb/decode.h" +#include "upb/internal/upb.h" +#include "upb/internal/vsnprintf_compat.h" #include "upb/reflection.h" -#include "upb/upb_internal.h" /* Must be last. */ #include "upb/port_def.inc" @@ -112,7 +113,7 @@ static void jsonenc_printf(jsonenc* e, const char* fmt, ...) { va_list args; va_start(args, fmt); - n = vsnprintf(e->ptr, have, fmt, args); + n = _upb_vsnprintf(e->ptr, have, fmt, args); va_end(args); if (UPB_LIKELY(have > n)) { @@ -209,7 +210,10 @@ static void jsonenc_enum(int32_t val, const upb_FieldDef* f, jsonenc* e) { if (strcmp(upb_EnumDef_FullName(e_def), "google.protobuf.NullValue") == 0) { jsonenc_putstr(e, "null"); } else { - const upb_EnumValueDef* ev = upb_EnumDef_FindValueByNumber(e_def, val); + const upb_EnumValueDef* ev = + (e->options & upb_JsonEncode_FormatEnumsAsIntegers) + ? NULL + : upb_EnumDef_FindValueByNumber(e_def, val); if (ev) { jsonenc_printf(e, "\"%s\"", upb_EnumValueDef_Name(ev)); diff --git a/third_party/upb/upb/json_encode.h b/third_party/upb/upb/json_encode.h index 1ba0b649e17..6e0cac3fc17 100644 --- a/third_party/upb/upb/json_encode.h +++ b/third_party/upb/upb/json_encode.h @@ -36,11 +36,14 @@ extern "C" { enum { /* When set, emits 0/default values. TODO(haberman): proto3 only? */ - upb_JsonEncode_EmitDefaults = 1, + upb_JsonEncode_EmitDefaults = 1 << 0, - /* When set, use normal (snake_caes) field names instead of JSON (camelCase) + /* When set, use normal (snake_case) field names instead of JSON (camelCase) names. */ - upb_JsonEncode_UseProtoNames = 2 + upb_JsonEncode_UseProtoNames = 1 << 1, + + /* When set, emits enums as their integer values instead of as their names. */ + upb_JsonEncode_FormatEnumsAsIntegers = 1 << 2 }; /* Encodes the given |msg| to JSON format. The message's reflection is given in diff --git a/third_party/upb/upb/json_test.cc b/third_party/upb/upb/json_test.cc new file mode 100644 index 00000000000..7abd23a93b1 --- /dev/null +++ b/third_party/upb/upb/json_test.cc @@ -0,0 +1,100 @@ +/* + * 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. + */ + +#include "google/protobuf/struct.upb.h" +#include "gtest/gtest.h" +#include "upb/def.hpp" +#include "upb/json_encode.h" +#include "upb/json_test.upb.h" +#include "upb/json_test.upbdefs.h" +#include "upb/upb.hpp" + +static std::string JsonEncode(const upb_test_Box* msg, int options) { + upb::Arena a; + upb::Status status; + upb::DefPool defpool; + upb::MessageDefPtr m(upb_test_Box_getmsgdef(defpool.ptr())); + EXPECT_TRUE(m.ptr() != nullptr); + + size_t json_size = upb_JsonEncode(msg, m.ptr(), defpool.ptr(), options, NULL, + 0, status.ptr()); + char* json_buf = (char*)upb_Arena_Malloc(a.ptr(), json_size + 1); + + size_t size = upb_JsonEncode(msg, m.ptr(), defpool.ptr(), options, json_buf, + json_size + 1, status.ptr()); + EXPECT_EQ(size, json_size); + return std::string(json_buf, json_size); +} + +// Encode a single optional enum. +TEST(JsonTest, EncodeEnum) { + upb::Arena a; + + upb_test_Box* foo = upb_test_Box_new(a.ptr()); + upb_test_Box_set_first_tag(foo, upb_test_Z_BAR); + + EXPECT_EQ(R"({"firstTag":"Z_BAR"})", JsonEncode(foo, 0)); + EXPECT_EQ(R"({"firstTag":1})", + JsonEncode(foo, upb_JsonEncode_FormatEnumsAsIntegers)); +} + +// Encode a single optional negative enum. +TEST(JsonTest, EncodeNegativeEnum) { + upb::Arena a; + + upb_test_Box* foo = upb_test_Box_new(a.ptr()); + upb_test_Box_set_last_tag(foo, upb_test_Z_BAZ); + + EXPECT_EQ(R"({"lastTag":"Z_BAZ"})", JsonEncode(foo, 0)); + EXPECT_EQ(R"({"lastTag":-2})", + JsonEncode(foo, upb_JsonEncode_FormatEnumsAsIntegers)); +} + +// Encode a single repeated enum. +TEST(JsonTest, EncodeRepeatedEnum) { + upb::Arena a; + + upb_test_Box* foo = upb_test_Box_new(a.ptr()); + upb_test_Box_add_more_tags(foo, upb_test_Z_BAT, a.ptr()); + + EXPECT_EQ(R"({"moreTags":["Z_BAT"]})", JsonEncode(foo, 0)); + EXPECT_EQ(R"({"moreTags":[13]})", + JsonEncode(foo, upb_JsonEncode_FormatEnumsAsIntegers)); +} + +// Special case: encode null enum. +TEST(JsonTest, EncodeNullEnum) { + upb::Arena a; + + upb_test_Box* foo = upb_test_Box_new(a.ptr()); + google_protobuf_Value_set_null_value(upb_test_Box_mutable_val(foo, a.ptr()), + google_protobuf_NULL_VALUE); + + EXPECT_EQ(R"({"val":null})", JsonEncode(foo, 0)); + EXPECT_EQ(R"({"val":null})", + JsonEncode(foo, upb_JsonEncode_FormatEnumsAsIntegers)); +} diff --git a/third_party/upb/upb/json_test.proto b/third_party/upb/upb/json_test.proto new file mode 100644 index 00000000000..d14b2f105a7 --- /dev/null +++ b/third_party/upb/upb/json_test.proto @@ -0,0 +1,20 @@ +syntax = "proto2"; + +package upb_test; + +import "google/protobuf/struct.proto"; + +enum Tag { + Z_NONE = 0; + Z_BAR = 1; + Z_BAZ = -2; + Z_BAT = 13; +} + +message Box { + optional Tag first_tag = 1; + repeated Tag more_tags = 2; + optional Tag last_tag = 5; + optional string name = 4; + optional google.protobuf.Value val = 6; +} diff --git a/third_party/upb/upb/map.c b/third_party/upb/upb/map.c new file mode 100644 index 00000000000..d92776f546d --- /dev/null +++ b/third_party/upb/upb/map.c @@ -0,0 +1,108 @@ +/* + * 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/map.h" + +#include + +#include "upb/internal/table.h" +#include "upb/msg.h" +#include "upb/port_def.inc" + +/* Strings/bytes are special-cased in maps. */ +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 */ +}; + +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]); +} + +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); +} + +void upb_Map_Clear(upb_Map* map) { _upb_Map_Clear(map); } + +upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key, + upb_MessageValue val, upb_Arena* arena) { + return (upb_MapInsertStatus)_upb_Map_Insert(map, &key, map->key_size, &val, + map->val_size, arena); +} + +bool upb_Map_Delete(upb_Map* map, upb_MessageValue key) { + return _upb_Map_Delete(map, &key, map->key_size); +} + +bool upb_MapIterator_Next(const upb_Map* map, size_t* iter) { + return _upb_map_next(map, iter); +} + +bool upb_MapIterator_Done(const upb_Map* map, size_t iter) { + upb_strtable_iter i; + 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_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter) { + upb_strtable_iter i; + 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_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter) { + upb_strtable_iter i; + 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_MapIterator_SetValue(upb_Map *map, size_t iter, upb_MessageValue + * value); */ diff --git a/third_party/upb/upb/map.h b/third_party/upb/upb/map.h new file mode 100644 index 00000000000..8ee0ddd05e4 --- /dev/null +++ b/third_party/upb/upb/map.h @@ -0,0 +1,117 @@ +/* + * 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_MAP_H_ +#define UPB_MAP_H_ + +#include "google/protobuf/descriptor.upb.h" +#include "upb/message_value.h" + +// Must be last. +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +/* Creates a new map on the given arena with the given key/value size. */ +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); + +/* 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_MessageValue key, + upb_MessageValue* val); + +/* Removes all entries in the map. */ +void upb_Map_Clear(upb_Map* map); + +typedef enum { + // LINT.IfChange + kUpb_MapInsertStatus_Inserted = 0, + kUpb_MapInsertStatus_Replaced = 1, + kUpb_MapInsertStatus_OutOfMemory = 2, + // LINT.ThenChange(//depot/google3/third_party/upb/upb/msg_internal.h) +} upb_MapInsertStatus; + +/* Sets the given key to the given value, returning whether the key was inserted + * or replaced. If the key was inserted, then any existing iterators will be + * invalidated. */ +upb_MapInsertStatus upb_Map_Insert(upb_Map* map, upb_MessageValue key, + upb_MessageValue val, upb_Arena* arena); + +/* Sets the given key to the given value. Returns false if memory allocation + * failed. If the key is newly inserted, then any existing iterators will be + * invalidated. */ +UPB_INLINE bool upb_Map_Set(upb_Map* map, upb_MessageValue key, + upb_MessageValue val, upb_Arena* arena) { + return upb_Map_Insert(map, key, val, arena) != + kUpb_MapInsertStatus_OutOfMemory; +} + +/* Deletes this key from the table. Returns true if the key was present. */ +bool upb_Map_Delete(upb_Map* map, upb_MessageValue key); + +/* Map iteration: + * + * 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_MapIterator_SetValue(map, iter, value2); + * } + */ + +/* Advances to the next entry. Returns false if no more entries are present. */ +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 + * 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_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_MapIterator_SetValue(upb_Map* map, size_t iter, + upb_MessageValue value); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* UPB_MAP_H_ */ diff --git a/third_party/upb/upb/message_value.h b/third_party/upb/upb/message_value.h new file mode 100644 index 00000000000..a08b90fc1ee --- /dev/null +++ b/third_party/upb/upb/message_value.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_MESSAGE_VALUE_H_ +#define UPB_MESSAGE_VALUE_H_ + +#include "google/protobuf/descriptor.upb.h" +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +// Definitions commn to both upb_Array and upb_Map. + +typedef union { + bool bool_val; + float float_val; + double double_val; + int32_t int32_val; + int64_t int64_val; + uint32_t uint32_val; + uint64_t uint64_val; + 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_Message* msg; + upb_Array* array; +} upb_MutableMessageValue; + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* UPB_MESSAGE_VALUE_H_ */ diff --git a/third_party/upb/upb/mini_descriptor.c b/third_party/upb/upb/mini_descriptor.c new file mode 100644 index 00000000000..21383704d25 --- /dev/null +++ b/third_party/upb/upb/mini_descriptor.c @@ -0,0 +1,255 @@ +/* + * 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. + */ + +#include "upb/mini_descriptor.h" + +#include +#include + +#include "upb/mini_table.h" + +// Must be last. +#include "upb/port_def.inc" + +/* DescState ******************************************************************/ + +// Manages the storage for mini descriptor strings as they are being encoded. +// TODO(b/234740652): Move some of this state directly into the encoder, maybe. + +typedef struct { + upb_MtDataEncoder e; + size_t bufsize; + char* buf; + char* ptr; +} DescState; + +static void upb_DescState_Init(DescState* d) { + d->bufsize = kUpb_MtDataEncoder_MinSize * 2; + d->buf = NULL; + d->ptr = NULL; +} + +static bool upb_DescState_Grow(DescState* d, upb_Arena* a) { + const size_t oldbufsize = d->bufsize; + const int used = d->ptr - d->buf; + + if (!d->buf) { + d->buf = upb_Arena_Malloc(a, d->bufsize); + if (!d->buf) return false; + d->ptr = d->buf; + d->e.end = d->buf + d->bufsize; + } + + if (oldbufsize - used < kUpb_MtDataEncoder_MinSize) { + d->bufsize *= 2; + d->buf = upb_Arena_Realloc(a, d->buf, oldbufsize, d->bufsize); + if (!d->buf) return false; + d->ptr = d->buf + used; + d->e.end = d->buf + d->bufsize; + } + + return true; +} + +static void upb_DescState_Emit(const DescState* d, upb_StringView* str) { + *str = upb_StringView_FromDataAndSize(d->buf, d->ptr - d->buf); +} + +/******************************************************************************/ + +// Copied from upbc/protoc-gen-upb.cc TODO(salo): can we consolidate? +static uint64_t upb_Field_Modifier(const upb_FieldDef* f) { + uint64_t out = 0; + if (upb_FieldDef_IsRepeated(f)) { + out |= kUpb_FieldModifier_IsRepeated; + } + if (upb_FieldDef_IsPacked(f)) { + out |= kUpb_FieldModifier_IsPacked; + } + if (upb_FieldDef_Type(f) == kUpb_FieldType_Enum) { + const upb_FileDef* file_def = upb_EnumDef_File(upb_FieldDef_EnumSubDef(f)); + if (upb_FileDef_Syntax(file_def) == kUpb_Syntax_Proto2) { + out |= kUpb_FieldModifier_IsClosedEnum; + } + } + if (upb_FieldDef_IsOptional(f) && !upb_FieldDef_HasPresence(f)) { + out |= kUpb_FieldModifier_IsProto3Singular; + } + if (upb_FieldDef_IsRequired(f)) { + out |= kUpb_FieldModifier_IsRequired; + } + return out; +} + +/******************************************************************************/ + +// Sort by enum value. +static int upb_MiniDescriptor_CompareEnums(const void* a, const void* b) { + const upb_EnumValueDef* A = *(void**)a; + const upb_EnumValueDef* B = *(void**)b; + if ((uint32_t)upb_EnumValueDef_Number(A) < + (uint32_t)upb_EnumValueDef_Number(B)) + return -1; + if ((uint32_t)upb_EnumValueDef_Number(A) > + (uint32_t)upb_EnumValueDef_Number(B)) + return 1; + return 0; +} + +// Sort by field number. +static int upb_MiniDescriptor_CompareFields(const void* a, const void* b) { + const upb_FieldDef* A = *(void**)a; + const upb_FieldDef* B = *(void**)b; + if (upb_FieldDef_Number(A) < upb_FieldDef_Number(B)) return -1; + if (upb_FieldDef_Number(A) > upb_FieldDef_Number(B)) return 1; + return 0; +} + +upb_StringView upb_MiniDescriptor_EncodeEnum(const upb_EnumDef* enum_def, + upb_Arena* a) { + upb_StringView out; + out.data = NULL; + out.size = 0; + + DescState s; + upb_DescState_Init(&s); + + // Copy and sort. + const size_t len = upb_EnumDef_ValueCount(enum_def); + const upb_EnumValueDef** sorted = upb_gmalloc(len * sizeof(void*)); + if (!sorted) goto err; + + for (size_t i = 0; i < len; i++) { + sorted[i] = upb_EnumDef_Value(enum_def, i); + } + qsort(sorted, len, sizeof(void*), upb_MiniDescriptor_CompareEnums); + + upb_MtDataEncoder_StartEnum(&s.e); + + for (size_t i = 0; i < len; i++) { + if (!upb_DescState_Grow(&s, a)) goto err; + const upb_EnumValueDef* value_def = sorted[i]; + const int number = upb_EnumValueDef_Number(value_def); + s.ptr = upb_MtDataEncoder_PutEnumValue(&s.e, s.ptr, number); + UPB_ASSERT(s.ptr); + } + + if (!upb_DescState_Grow(&s, a)) goto err; + s.ptr = upb_MtDataEncoder_EndEnum(&s.e, s.ptr); + UPB_ASSERT(s.ptr); + + upb_DescState_Emit(&s, &out); + +err: + if (sorted) upb_gfree(sorted); + return out; +} + +upb_StringView upb_MiniDescriptor_EncodeExtension(const upb_FieldDef* field_def, + upb_Arena* a) { + upb_StringView out; + out.data = NULL; + out.size = 0; + + DescState s; + upb_DescState_Init(&s); + + if (!upb_DescState_Grow(&s, a)) goto err; + upb_MtDataEncoder_StartMessage(&s.e, s.ptr, 0); + + UPB_ASSERT(upb_FieldDef_IsExtension(field_def)); + const upb_FieldType type = upb_FieldDef_Type(field_def); + const int number = upb_FieldDef_Number(field_def); + const uint64_t modifier = upb_Field_Modifier(field_def); + upb_MtDataEncoder_PutField(&s.e, s.ptr, type, number, modifier); + + upb_DescState_Emit(&s, &out); + +err: + return out; +} + +upb_StringView upb_MiniDescriptor_EncodeMessage( + const upb_MessageDef* message_def, upb_Arena* a) { + upb_StringView out; + out.data = NULL; + out.size = 0; + + DescState s; + upb_DescState_Init(&s); + + // Make a copy. + const size_t len = upb_MessageDef_FieldCount(message_def); + const upb_FieldDef** sorted = upb_gmalloc(len * sizeof(void*)); + if (!sorted) goto err; + + // Sort the copy. + for (size_t i = 0; i < len; i++) { + sorted[i] = upb_MessageDef_Field(message_def, i); + } + qsort(sorted, len, sizeof(void*), upb_MiniDescriptor_CompareFields); + + if (!upb_DescState_Grow(&s, a)) goto err; + upb_MtDataEncoder_StartMessage(&s.e, s.ptr, 0); + + // Encode the fields. + for (size_t i = 0; i < len; i++) { + const upb_FieldDef* field_def = sorted[i]; + const int number = upb_FieldDef_Number(field_def); + const upb_FieldType type = upb_FieldDef_Type(field_def); + const uint64_t modifier = upb_Field_Modifier(field_def); + + if (!upb_DescState_Grow(&s, a)) goto err; + s.ptr = upb_MtDataEncoder_PutField(&s.e, s.ptr, type, number, modifier); + UPB_ASSERT(s.ptr); + } + + // Encode the oneofs. + const int oneof_count = upb_MessageDef_OneofCount(message_def); + for (int i = 0; i < oneof_count; i++) { + if (!upb_DescState_Grow(&s, a)) goto err; + s.ptr = upb_MtDataEncoder_StartOneof(&s.e, s.ptr); + UPB_ASSERT(s.ptr); + + const upb_OneofDef* oneof_def = upb_MessageDef_Oneof(message_def, i); + const int field_count = upb_OneofDef_FieldCount(oneof_def); + for (int j = 0; j < field_count; j++) { + const upb_FieldDef* field_def = upb_OneofDef_Field(oneof_def, j); + const int number = upb_FieldDef_Number(field_def); + + if (!upb_DescState_Grow(&s, a)) goto err; + s.ptr = upb_MtDataEncoder_PutOneofField(&s.e, s.ptr, number); + UPB_ASSERT(s.ptr); + } + } + + upb_DescState_Emit(&s, &out); + +err: + if (sorted) upb_gfree(sorted); + return out; +} diff --git a/third_party/upb/upb/mini_descriptor.h b/third_party/upb/upb/mini_descriptor.h new file mode 100644 index 00000000000..829d008048f --- /dev/null +++ b/third_party/upb/upb/mini_descriptor.h @@ -0,0 +1,58 @@ +/* + * 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_DESCRIPTOR_H_ +#define UPB_MINI_DESCRIPTOR_H_ + +#include "upb/def.h" +#include "upb/upb.h" + +// Must be last. +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +/** upb_MiniDescriptor ********************************************************/ + +upb_StringView upb_MiniDescriptor_EncodeEnum(const upb_EnumDef* enum_def, + upb_Arena* a); + +upb_StringView upb_MiniDescriptor_EncodeExtension(const upb_FieldDef* field_def, + upb_Arena* a); + +upb_StringView upb_MiniDescriptor_EncodeMessage( + const upb_MessageDef* message_def, upb_Arena* a); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* UPB_MINI_DESCRIPTOR_H_ */ diff --git a/third_party/upb/upb/mini_table.c b/third_party/upb/upb/mini_table.c index d09299e9aac..cd53059738f 100644 --- a/third_party/upb/upb/mini_table.c +++ b/third_party/upb/upb/mini_table.c @@ -79,6 +79,7 @@ enum { kUpb_EncodedValue_FieldSeparator = '|', kUpb_EncodedValue_MinOneofField = ' ', kUpb_EncodedValue_MaxOneofField = 'b', + kUpb_EncodedValue_MaxEnumMask = 'A', }; char upb_ToBase92(int8_t ch) { @@ -124,18 +125,31 @@ bool upb_IsTypePackable(upb_FieldType type) { /** upb_MtDataEncoder *********************************************************/ typedef struct { - char* buf_start; // Only for checking kUpb_MtDataEncoder_MinSize. - uint64_t msg_mod; + uint64_t present_values_mask; + uint32_t last_written_value; +} upb_MtDataEncoderInternal_EnumState; + +typedef struct { + uint64_t msg_modifiers; uint32_t last_field_num; enum { kUpb_OneofState_NotStarted, kUpb_OneofState_StartedOneof, kUpb_OneofState_EmittedOneofField, } oneof_state; +} upb_MtDataEncoderInternal_MsgState; + +typedef struct { + char* buf_start; // Only for checking kUpb_MtDataEncoder_MinSize. + union { + upb_MtDataEncoderInternal_EnumState enum_state; + upb_MtDataEncoderInternal_MsgState msg_state; + } state; } upb_MtDataEncoderInternal; static upb_MtDataEncoderInternal* upb_MtDataEncoder_GetInternal( upb_MtDataEncoder* e, char* buf_start) { + UPB_ASSERT(sizeof(upb_MtDataEncoderInternal) <= sizeof(e->internal)); upb_MtDataEncoderInternal* ret = (upb_MtDataEncoderInternal*)e->internal; ret->buf_start = buf_start; return ret; @@ -176,9 +190,9 @@ char* upb_MtDataEncoder_PutModifier(upb_MtDataEncoder* e, char* 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; + in->state.msg_state.msg_modifiers = msg_mod; + in->state.msg_state.last_field_num = 0; + in->state.msg_state.oneof_state = kUpb_OneofState_NotStarted; return upb_MtDataEncoder_PutModifier(e, ptr, msg_mod); } @@ -207,16 +221,16 @@ char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, }; 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) { + if (field_num <= in->state.msg_state.last_field_num) return NULL; + if (in->state.msg_state.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; + UPB_ASSERT(field_num > in->state.msg_state.last_field_num); + uint32_t skip = field_num - in->state.msg_state.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; + in->state.msg_state.last_field_num = field_num; uint32_t encoded_modifiers = 0; @@ -234,8 +248,8 @@ char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, if (upb_IsTypePackable(type)) { bool field_is_packed = field_mod & kUpb_FieldModifier_IsPacked; - bool default_is_packed = - in->msg_mod & kUpb_MessageModifier_DefaultIsPacked; + bool default_is_packed = in->state.msg_state.msg_modifiers & + kUpb_MessageModifier_DefaultIsPacked; if (field_is_packed != default_is_packed) { encoded_modifiers |= kUpb_EncodedFieldModifier_FlipPacked; } @@ -255,30 +269,77 @@ char* upb_MtDataEncoder_PutField(upb_MtDataEncoder* e, char* ptr, char* upb_MtDataEncoder_StartOneof(upb_MtDataEncoder* e, char* ptr) { upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); - if (in->oneof_state == kUpb_OneofState_NotStarted) { + if (in->state.msg_state.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; + in->state.msg_state.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) { + if (in->state.msg_state.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; + in->state.msg_state.oneof_state = kUpb_OneofState_EmittedOneofField; + return ptr; +} + +void upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, NULL); + in->state.enum_state.present_values_mask = 0; + in->state.enum_state.last_written_value = 0; +} + +static char* upb_MtDataEncoder_FlushDenseEnumMask(upb_MtDataEncoder* e, + char* ptr) { + upb_MtDataEncoderInternal* in = (upb_MtDataEncoderInternal*)e->internal; + ptr = upb_MtDataEncoder_Put(e, ptr, in->state.enum_state.present_values_mask); + in->state.enum_state.present_values_mask = 0; + in->state.enum_state.last_written_value += 5; return ptr; } +char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr, + uint32_t val) { + // TODO(b/229641772): optimize this encoding. + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + UPB_ASSERT(val >= in->state.enum_state.last_written_value); + uint32_t delta = val - in->state.enum_state.last_written_value; + if (delta >= 5 && in->state.enum_state.present_values_mask) { + ptr = upb_MtDataEncoder_FlushDenseEnumMask(e, ptr); + if (!ptr) { + return NULL; + } + delta -= 5; + } + + if (delta >= 5) { + ptr = upb_MtDataEncoder_PutBase92Varint( + e, ptr, delta, kUpb_EncodedValue_MinSkip, kUpb_EncodedValue_MaxSkip); + in->state.enum_state.last_written_value += delta; + delta = 0; + } + + UPB_ASSERT((in->state.enum_state.present_values_mask >> delta) == 0); + in->state.enum_state.present_values_mask |= 1ULL << delta; + return ptr; +} + +char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr) { + upb_MtDataEncoderInternal* in = upb_MtDataEncoder_GetInternal(e, ptr); + if (!in->state.enum_state.present_values_mask) return ptr; + return upb_MtDataEncoder_FlushDenseEnumMask(e, ptr); +} + const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber( const upb_MiniTable* table, uint32_t number) { int n = table->field_count; @@ -367,7 +428,7 @@ static const char* upb_MiniTable_DecodeBase92Varint(upb_MtDecoder* d, char ch = first_ch; while (1) { uint32_t bits = upb_FromBase92(ch) - upb_FromBase92(min); - UPB_ASSERT(shift < 32 - bits_per_char); + UPB_ASSERT(shift < 32); val |= bits << shift; if (ptr == d->end || *ptr < min || max < *ptr) { *out_val = val; @@ -689,6 +750,9 @@ static void upb_MtDecoder_Parse(upb_MtDecoder* d, const char* ptr, size_t len, } else if (kUpb_EncodedValue_MinModifier <= ch && ch <= kUpb_EncodedValue_MaxModifier) { ptr = upb_MtDecoder_ParseModifier(d, ptr, ch, last_field, &msg_modifiers); + if (msg_modifiers & kUpb_MessageModifier_IsExtendable) { + d->table->ext |= kUpb_ExtMode_Extendable; + } } else if (ch == kUpb_EncodedValue_End) { if (!d->table) { upb_MtDecoder_ErrorFormat(d, "Extensions cannot have oneofs."); @@ -854,18 +918,12 @@ static void upb_MtDecoder_AssignOffsets(upb_MtDecoder* d) { } } - 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; - } - } + // The fasttable parser (supported on 64-bit only) depends on this being a + // multiple of 8 in order to satisfy UPB_MALLOC_ALIGN, which is also 8. + // + // On 32-bit we could potentially make this smaller, but there is no + // compelling reason to optimize this right now. + d->table->size = UPB_ALIGN_UP(d->table->size, 8); } upb_MiniTable* upb_MiniTable_BuildWithBuf(const char* data, size_t len, @@ -968,48 +1026,67 @@ upb_MiniTable* upb_MiniTable_BuildMapEntry(upb_FieldType key_type, return ret; } +static bool upb_MiniTable_BuildEnumValue(upb_MtDecoder* d, + upb_MiniTable_Enum* table, + uint32_t val, upb_Arena* arena) { + if (val < 64) { + table->mask |= 1ULL << val; + return true; + } + + int32_t* values = (void*)table->values; + values = upb_Arena_Realloc(arena, values, table->value_count * 4, + (table->value_count + 1) * 4); + upb_MtDecoder_CheckOutOfMemory(d, values); + values[table->value_count++] = (int32_t)val; + table->values = values; + return true; +} + upb_MiniTable_Enum* upb_MiniTable_BuildEnum(const char* data, size_t len, upb_Arena* arena, upb_Status* status) { - upb_MtDecoder decoder = { + upb_MtDecoder d = { .status = status, + .end = UPB_PTRADD(data, len), }; - if (UPB_SETJMP(decoder.err)) { + if (UPB_SETJMP(d.err)) { return NULL; } upb_MiniTable_Enum* table = upb_Arena_Malloc(arena, sizeof(*table)); - upb_MtDecoder_CheckOutOfMemory(&decoder, table); + upb_MtDecoder_CheckOutOfMemory(&d, 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; - } + uint32_t base = 0; - 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(); + while (ptr < d.end) { + char ch = *ptr++; + if (ch <= kUpb_EncodedValue_MaxEnumMask) { + uint32_t mask = upb_FromBase92(ch); + for (int i = 0; i < 5; i++, base++, mask >>= 1) { + if (mask & 1) { + if (!upb_MiniTable_BuildEnumValue(&d, table, base, arena)) { + return NULL; + } + } + } + } else if (kUpb_EncodedValue_MinSkip <= ch && + ch <= kUpb_EncodedValue_MaxSkip) { + uint32_t skip; + ptr = upb_MiniTable_DecodeBase92Varint(&d, ptr, ch, + kUpb_EncodedValue_MinSkip, + kUpb_EncodedValue_MaxSkip, &skip); + base += skip; + } else { + upb_Status_SetErrorFormat(status, "Unexpected character: %c", ch); + return NULL; } - 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; diff --git a/third_party/upb/upb/mini_table.h b/third_party/upb/upb/mini_table.h index 2bc71a9a956..6c41f810ebe 100644 --- a/third_party/upb/upb/mini_table.h +++ b/third_party/upb/upb/mini_table.h @@ -40,6 +40,28 @@ extern "C" { const upb_MiniTable_Field* upb_MiniTable_FindFieldByNumber( const upb_MiniTable* table, uint32_t number); +UPB_INLINE const upb_MiniTable* upb_MiniTable_GetSubMessageTable( + const upb_MiniTable* mini_table, const upb_MiniTable_Field* field) { + return mini_table->subs[field->submsg_index].submsg; +} + +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 & (1ULL << 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; +} + +/** upb_MtDataEncoder *********************************************************/ + +// Functions to encode a string in a format that can be loaded by +// upb_MiniTable_Build(). + typedef enum { kUpb_MessageModifier_ValidateUtf8 = 1 << 0, kUpb_MessageModifier_DefaultIsPacked = 1 << 1, @@ -54,11 +76,6 @@ typedef enum { 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. @@ -103,10 +120,10 @@ char* upb_MtDataEncoder_PutOneofField(upb_MtDataEncoder* e, char* ptr, // 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); +void upb_MtDataEncoder_StartEnum(upb_MtDataEncoder* e); char* upb_MtDataEncoder_PutEnumValue(upb_MtDataEncoder* e, char* ptr, uint32_t val); -char* upb_MtDataEncoder_FinishEnum(upb_MtDataEncoder* e, char* ptr); +char* upb_MtDataEncoder_EndEnum(upb_MtDataEncoder* e, char* ptr); /** upb_MiniTable *************************************************************/ diff --git a/third_party/upb/upb/mini_table.hpp b/third_party/upb/upb/mini_table.hpp index 06405f9da34..57de9e9e3e0 100644 --- a/third_party/upb/upb/mini_table.hpp +++ b/third_party/upb/upb/mini_table.hpp @@ -65,6 +65,19 @@ class MtDataEncoder { }); } + void StartEnum() { upb_MtDataEncoder_StartEnum(&encoder_); } + + bool PutEnumValue(uint32_t enum_value) { + return appender_([=](char* buf) { + return upb_MtDataEncoder_PutEnumValue(&encoder_, buf, enum_value); + }); + } + + bool EndEnum() { + return appender_( + [=](char* buf) { return upb_MtDataEncoder_EndEnum(&encoder_, buf); }); + } + const std::string& data() const { return appender_.data(); } private: diff --git a/third_party/upb/upb/mini_table_accessors.c b/third_party/upb/upb/mini_table_accessors.c new file mode 100644 index 00000000000..b04a7cf116a --- /dev/null +++ b/third_party/upb/upb/mini_table_accessors.c @@ -0,0 +1,397 @@ +/* + * 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_accessors.h" + +#include "upb/mini_table.h" +#include "upb/msg_internal.h" + +// Must be last. +#include "upb/port_def.inc" + +size_t upb_MiniTable_Field_GetSize(const upb_MiniTable_Field* f) { + static unsigned char sizes[] = { + 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_IsRepeatedOrMap(f) ? sizeof(void*) : sizes[f->descriptortype]; +} + +// Maps descriptor type to elem_size_lg2. +int upb_MiniTable_Field_CTypeLg2Size(const upb_MiniTable_Field* f) { + static const uint8_t sizes[] = { + -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 */ + }; + return sizes[f->descriptortype]; +} + +bool upb_MiniTable_HasField(const upb_Message* msg, + const upb_MiniTable_Field* field) { + if (_upb_MiniTable_Field_InOneOf(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_MiniTable_GetMessage(msg, field) != NULL; + } +} + +void upb_MiniTable_ClearField(upb_Message* msg, + const upb_MiniTable_Field* field) { + char* mem = UPB_PTR_AT(msg, field->offset, char); + if (field->presence > 0) { + _upb_clearhas_field(msg, field); + } else if (_upb_MiniTable_Field_InOneOf(field)) { + uint32_t* oneof_case = _upb_oneofcase_field(msg, field); + if (*oneof_case != field->number) return; + *oneof_case = 0; + } + memset(mem, 0, upb_MiniTable_Field_GetSize(field)); +} + +void* upb_MiniTable_ResizeArray(upb_Message* msg, + const upb_MiniTable_Field* field, size_t len, + upb_Arena* arena) { + return _upb_Array_Resize_accessor2( + msg, field->offset, len, upb_MiniTable_Field_CTypeLg2Size(field), arena); +} + +typedef struct { + const char* ptr; + uint64_t val; +} decode_vret; + +UPB_NOINLINE +static decode_vret decode_longvarint64(const char* ptr, uint64_t val) { + decode_vret ret = {NULL, 0}; + uint64_t byte; + int i; + for (i = 1; i < 10; i++) { + byte = (uint8_t)ptr[i]; + val += (byte - 1) << (i * 7); + if (!(byte & 0x80)) { + ret.ptr = ptr + i + 1; + ret.val = val; + return ret; + } + } + return ret; +} + +UPB_FORCEINLINE +static const char* decode_varint64(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) return NULL; + *val = res.val; + return res.ptr; + } +} + +UPB_FORCEINLINE +static const char* decode_tag(const char* ptr, uint32_t* val) { + uint64_t byte = (uint8_t)*ptr; + if (UPB_LIKELY((byte & 0x80) == 0)) { + *val = (uint32_t)byte; + return ptr + 1; + } else { + const char* start = ptr; + decode_vret res = decode_longvarint64(ptr, byte); + if (!res.ptr || res.ptr - start > 5 || res.val > UINT32_MAX) { + return NULL; // Malformed. + } + *val = (uint32_t)res.val; + return res.ptr; + } +} + +typedef enum { + kUpb_FindUnknown_Ok, + kUpb_FindUnknown_NotPresent, + kUpb_FindUnknown_ParseError, +} upb_FindUnknown_Status; + +typedef struct { + upb_FindUnknown_Status status; + const char* ptr; + size_t len; +} find_unknown_ret; + +static find_unknown_ret UnknownFieldSet_FindField(const upb_Message* msg, + int field_number); + +upb_GetExtension_Status upb_MiniTable_GetOrPromoteExtension( + upb_Message* msg, const upb_MiniTable_Extension* ext_table, + int decode_options, upb_Arena* arena, + const upb_Message_Extension** extension) { + UPB_ASSERT(ext_table->field.descriptortype == kUpb_FieldType_Message); + *extension = _upb_Message_Getext(msg, ext_table); + if (*extension) { + return kUpb_GetExtension_Ok; + } + + // Check unknown fields, if available promote. + int field_number = ext_table->field.number; + find_unknown_ret result = UnknownFieldSet_FindField(msg, field_number); + if (result.status != kUpb_FindUnknown_Ok) { + UPB_ASSERT(result.status != kUpb_GetExtension_ParseError); + return kUpb_GetExtension_NotPresent; + } + // Decode and promote from unknown. + const upb_MiniTable* extension_table = ext_table->sub.submsg; + upb_Message* extension_msg = _upb_Message_New(extension_table, arena); + if (!extension_msg) { + return kUpb_GetExtension_OutOfMemory; + } + const char* data = result.ptr; + uint32_t tag; + uint64_t message_len; + data = decode_tag(data, &tag); + data = decode_varint64(data, &message_len); + upb_DecodeStatus status = + upb_Decode(data, message_len, extension_msg, extension_table, NULL, + decode_options, arena); + if (status == kUpb_DecodeStatus_OutOfMemory) { + return kUpb_GetExtension_OutOfMemory; + } + if (status != kUpb_DecodeStatus_Ok) return kUpb_GetExtension_ParseError; + // Add to extensions. + upb_Message_Extension* ext = + _upb_Message_GetOrCreateExtension(msg, ext_table, arena); + if (!ext) { + return kUpb_GetExtension_OutOfMemory; + } + memcpy(&ext->data, &extension_msg, sizeof(extension_msg)); + *extension = ext; + // Remove unknown field. + upb_Message_Internal* in = upb_Message_Getinternal(msg); + const char* internal_unknown_end = + UPB_PTR_AT(in->internal, in->internal->unknown_end, char); + if ((result.ptr + result.len) != internal_unknown_end) { + memmove((char*)result.ptr, result.ptr + result.len, + internal_unknown_end - result.ptr - result.len); + } + in->internal->unknown_end -= result.len; + return kUpb_GetExtension_Ok; +} + +upb_GetExtensionAsBytes_Status upb_MiniTable_GetExtensionAsBytes( + const upb_Message* msg, const upb_MiniTable_Extension* ext_table, + int encode_options, upb_Arena* arena, const char** extension_data, + size_t* len) { + const upb_Message_Extension* msg_ext = _upb_Message_Getext(msg, ext_table); + UPB_ASSERT(ext_table->field.descriptortype == kUpb_FieldType_Message); + if (msg_ext) { + upb_EncodeStatus status = + upb_Encode(msg_ext->data.ptr, msg_ext->ext->sub.submsg, encode_options, + arena, (char**)extension_data, len); + if (status != kUpb_EncodeStatus_Ok) { + return kUpb_GetExtensionAsBytes_EncodeError; + } + return kUpb_GetExtensionAsBytes_Ok; + } + int field_number = ext_table->field.number; + find_unknown_ret result = UnknownFieldSet_FindField(msg, field_number); + if (result.status != kUpb_FindUnknown_Ok) { + UPB_ASSERT(result.status != kUpb_GetExtension_ParseError); + return kUpb_GetExtensionAsBytes_NotPresent; + } + const char* data = result.ptr; + uint32_t tag; + uint64_t message_len; + data = decode_tag(data, &tag); + data = decode_varint64(data, &message_len); + *extension_data = data; + *len = message_len; + return kUpb_GetExtensionAsBytes_Ok; +} + +static const char* UnknownFieldSet_SkipGroup(const char* ptr, const char* end, + int group_number); + +static const char* UnknownFieldSet_SkipField(const char* ptr, const char* end, + uint32_t tag) { + int field_number = tag >> 3; + int wire_type = tag & 7; + switch (wire_type) { + case kUpb_WireType_Varint: { + uint64_t val; + return decode_varint64(ptr, &val); + } + case kUpb_WireType_64Bit: + if (end - ptr < 8) return NULL; + return ptr + 8; + case kUpb_WireType_32Bit: + if (end - ptr < 4) return NULL; + return ptr + 4; + case kUpb_WireType_Delimited: { + uint64_t size; + ptr = decode_varint64(ptr, &size); + if (!ptr || end - ptr < size) return NULL; + return ptr + size; + } + case kUpb_WireType_StartGroup: + return UnknownFieldSet_SkipGroup(ptr, end, field_number); + case kUpb_WireType_EndGroup: + return NULL; + default: + assert(0); + return NULL; + } +} + +static const char* UnknownFieldSet_SkipGroup(const char* ptr, const char* end, + int group_number) { + uint32_t end_tag = (group_number << 3) | kUpb_WireType_EndGroup; + while (true) { + if (ptr == end) return NULL; + uint64_t tag; + ptr = decode_varint64(ptr, &tag); + if (!ptr) return NULL; + if (tag == end_tag) return ptr; + ptr = UnknownFieldSet_SkipField(ptr, end, (uint32_t)tag); + if (!ptr) return NULL; + } + return ptr; +} + +enum { + kUpb_MessageSet_StartItemTag = (1 << 3) | kUpb_WireType_StartGroup, + kUpb_MessageSet_EndItemTag = (1 << 3) | kUpb_WireType_EndGroup, + kUpb_MessageSet_TypeIdTag = (2 << 3) | kUpb_WireType_Varint, + kUpb_MessageSet_MessageTag = (3 << 3) | kUpb_WireType_Delimited, +}; + +static find_unknown_ret UnknownFieldSet_FindField(const upb_Message* msg, + int field_number) { + size_t size; + find_unknown_ret ret; + + const char* ptr = upb_Message_GetUnknown(msg, &size); + if (size == 0) { + ret.ptr = NULL; + return ret; + } + const char* end = ptr + size; + uint64_t uint64_val; + + while (ptr < end) { + uint32_t tag; + int field; + int wire_type; + const char* unknown_begin = ptr; + ptr = decode_tag(ptr, &tag); + field = tag >> 3; + wire_type = tag & 7; + switch (wire_type) { + case kUpb_WireType_EndGroup: + ret.status = kUpb_FindUnknown_ParseError; + return ret; + case kUpb_WireType_Varint: + ptr = decode_varint64(ptr, &uint64_val); + if (!ptr) { + ret.status = kUpb_FindUnknown_ParseError; + return ret; + } + break; + case kUpb_WireType_32Bit: + ptr += 4; + break; + case kUpb_WireType_64Bit: + ptr += 8; + break; + case kUpb_WireType_Delimited: + // Read size. + ptr = decode_varint64(ptr, &uint64_val); + if (uint64_val >= INT32_MAX || !ptr) { + ret.status = kUpb_FindUnknown_ParseError; + return ret; + } + ptr += uint64_val; + break; + case kUpb_WireType_StartGroup: + // tag >> 3 specifies the group number, recurse and skip + // until we see group end tag. + ptr = UnknownFieldSet_SkipGroup(ptr, end, field_number); + break; + default: + ret.status = kUpb_FindUnknown_ParseError; + return ret; + } + if (field_number == field) { + ret.status = kUpb_FindUnknown_Ok; + ret.ptr = unknown_begin; + ret.len = ptr - unknown_begin; + return ret; + } + } + ret.status = kUpb_FindUnknown_NotPresent; + ret.ptr = NULL; + ret.len = 0; + return ret; +} diff --git a/third_party/upb/upb/mini_table_accessors.h b/third_party/upb/upb/mini_table_accessors.h new file mode 100644 index 00000000000..750f66f2074 --- /dev/null +++ b/third_party/upb/upb/mini_table_accessors.h @@ -0,0 +1,271 @@ +/* + * 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_ACCESSORS_H_ +#define UPB_MINI_TABLE_ACCESSORS_H_ + +#include "upb/array.h" +#include "upb/internal/mini_table_accessors.h" +#include "upb/msg_internal.h" + +// Must be last. +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +bool upb_MiniTable_HasField(const upb_Message* msg, + const upb_MiniTable_Field* field); + +void upb_MiniTable_ClearField(upb_Message* msg, + const upb_MiniTable_Field* field); + +UPB_INLINE bool upb_MiniTable_GetBool(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Bool); + return *UPB_PTR_AT(msg, field->offset, bool); +} + +UPB_INLINE void upb_MiniTable_SetBool(upb_Message* msg, + const upb_MiniTable_Field* field, + bool value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Bool); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, bool) = value; +} + +UPB_INLINE int32_t upb_MiniTable_GetInt32(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Int32 || + field->descriptortype == kUpb_FieldType_SInt32 || + field->descriptortype == kUpb_FieldType_SFixed32); + return *UPB_PTR_AT(msg, field->offset, int32_t); +} + +UPB_INLINE void upb_MiniTable_SetInt32(upb_Message* msg, + const upb_MiniTable_Field* field, + int32_t value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Int32 || + field->descriptortype == kUpb_FieldType_SInt32 || + field->descriptortype == kUpb_FieldType_SFixed32); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, int32_t) = value; +} + +UPB_INLINE uint32_t upb_MiniTable_GetUInt32(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_UInt32 || + field->descriptortype == kUpb_FieldType_Fixed32); + return *UPB_PTR_AT(msg, field->offset, uint32_t); +} + +UPB_INLINE void upb_MiniTable_SetUInt32(upb_Message* msg, + const upb_MiniTable_Field* field, + uint32_t value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_UInt32 || + field->descriptortype == kUpb_FieldType_Fixed32); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, uint32_t) = value; +} + +UPB_INLINE int32_t upb_MiniTable_GetEnum(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Enum); + return *UPB_PTR_AT(msg, field->offset, int32_t); +} + +UPB_INLINE void upb_MiniTable_SetEnum(upb_Message* msg, + const upb_MiniTable_Field* field, + int32_t value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Enum); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, int32_t) = value; +} + +UPB_INLINE int64_t upb_MiniTable_GetInt64(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Int64 || + field->descriptortype == kUpb_FieldType_SInt64 || + field->descriptortype == kUpb_FieldType_SFixed64); + return *UPB_PTR_AT(msg, field->offset, int64_t); +} + +UPB_INLINE void upb_MiniTable_SetInt64(upb_Message* msg, + const upb_MiniTable_Field* field, + int64_t value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Int64 || + field->descriptortype == kUpb_FieldType_SInt64 || + field->descriptortype == kUpb_FieldType_SFixed64); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, int64_t) = value; +} + +UPB_INLINE uint64_t upb_MiniTable_GetUInt64(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_UInt64 || + field->descriptortype == kUpb_FieldType_Fixed64); + return *UPB_PTR_AT(msg, field->offset, uint64_t); +} + +UPB_INLINE void upb_MiniTable_SetUInt64(upb_Message* msg, + const upb_MiniTable_Field* field, + uint64_t value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_UInt64 || + field->descriptortype == kUpb_FieldType_Fixed64); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, uint64_t) = value; +} + +UPB_INLINE float upb_MiniTable_GetFloat(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Float); + return *UPB_PTR_AT(msg, field->offset, float); +} + +UPB_INLINE void upb_MiniTable_SetFloat(upb_Message* msg, + const upb_MiniTable_Field* field, + float value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Float); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, float) = value; +} + +UPB_INLINE double upb_MiniTable_GetDouble(const upb_Message* msg, + const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Double); + return *UPB_PTR_AT(msg, field->offset, double); +} + +UPB_INLINE void upb_MiniTable_SetDouble(upb_Message* msg, + const upb_MiniTable_Field* field, + double value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Double); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, double) = value; +} + +UPB_INLINE upb_StringView upb_MiniTable_GetString( + const upb_Message* msg, const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Bytes || + field->descriptortype == kUpb_FieldType_String); + return *UPB_PTR_AT(msg, field->offset, upb_StringView); +} + +UPB_INLINE void upb_MiniTable_SetString(upb_Message* msg, + const upb_MiniTable_Field* field, + upb_StringView value) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Bytes || + field->descriptortype == kUpb_FieldType_String); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, upb_StringView) = value; +} + +UPB_INLINE const upb_Message* upb_MiniTable_GetMessage( + const upb_Message* msg, const upb_MiniTable_Field* field) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); + return *UPB_PTR_AT(msg, field->offset, const upb_Message*); +} + +UPB_INLINE void upb_MiniTable_SetMessage(upb_Message* msg, + const upb_MiniTable_Field* field, + upb_Message* sub_message) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); + _upb_MiniTable_SetPresence(msg, field); + *UPB_PTR_AT(msg, field->offset, const upb_Message*) = sub_message; +} + +UPB_INLINE upb_Message* upb_MiniTable_GetMutableMessage( + upb_Message* msg, const upb_MiniTable* mini_table, + const upb_MiniTable_Field* field, upb_Arena* arena) { + UPB_ASSERT(field->descriptortype == kUpb_FieldType_Message || + field->descriptortype == kUpb_FieldType_Group); + upb_Message* sub_message = *UPB_PTR_AT(msg, field->offset, upb_Message*); + if (!sub_message) { + sub_message = + _upb_Message_New(mini_table->subs[field->submsg_index].submsg, arena); + *UPB_PTR_AT(msg, field->offset, upb_Message*) = sub_message; + _upb_MiniTable_SetPresence(msg, field); + } + return sub_message; +} + +UPB_INLINE const upb_Array* upb_MiniTable_GetArray( + const upb_Message* msg, const upb_MiniTable_Field* field) { + return (const upb_Array*)*UPB_PTR_AT(msg, field->offset, upb_Array*); +} + +UPB_INLINE upb_Array* upb_MiniTable_GetMutableArray( + upb_Message* msg, const upb_MiniTable_Field* field) { + return (upb_Array*)*UPB_PTR_AT(msg, field->offset, upb_Array*); +} + +void* upb_MiniTable_ResizeArray(upb_Message* msg, + const upb_MiniTable_Field* field, size_t len, + upb_Arena* arena); +typedef enum { + kUpb_GetExtension_Ok, + kUpb_GetExtension_NotPresent, + kUpb_GetExtension_ParseError, + kUpb_GetExtension_OutOfMemory, +} upb_GetExtension_Status; + +typedef enum { + kUpb_GetExtensionAsBytes_Ok, + kUpb_GetExtensionAsBytes_NotPresent, + kUpb_GetExtensionAsBytes_EncodeError, +} upb_GetExtensionAsBytes_Status; + +// Returns a message extension or promotes an unknown field to +// an extension. +// +// TODO(ferhat): Only supports extension fields that are messages, +// expand support to include non-message types. +upb_GetExtension_Status upb_MiniTable_GetOrPromoteExtension( + upb_Message* msg, const upb_MiniTable_Extension* ext_table, + int decode_options, upb_Arena* arena, + const upb_Message_Extension** extension); + +// Returns a message extension or unknown field matching the extension +// data as bytes. +// +// If an extension has already been decoded it will be re-encoded +// to bytes. +upb_GetExtensionAsBytes_Status upb_MiniTable_GetExtensionAsBytes( + const upb_Message* msg, const upb_MiniTable_Extension* ext_table, + int encode_options, upb_Arena* arena, const char** extension_data, + size_t* len); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif // UPB_MINI_TABLE_ACCESSORS_H_ diff --git a/third_party/upb/upb/mini_table_accessors_internal.h b/third_party/upb/upb/mini_table_accessors_internal.h new file mode 100644 index 00000000000..8368b65bd43 --- /dev/null +++ b/third_party/upb/upb/mini_table_accessors_internal.h @@ -0,0 +1,36 @@ +/* + * 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_ACCESSORS_INTERNAL_H_ +#define UPB_MINI_TABLE_ACCESSORS_INTERNAL_H_ + +// TODO(b/232091617): Delete this entire header which currently exists only for +// temporary backwards compatibility. + +#include "upb/internal/mini_table_accessors.h" + +#endif // UPB_MINI_TABLE_ACCESSORS_INTERNAL_H_ diff --git a/third_party/upb/upb/mini_table_accessors_test.cc b/third_party/upb/upb/mini_table_accessors_test.cc new file mode 100644 index 00000000000..16274476ad9 --- /dev/null +++ b/third_party/upb/upb/mini_table_accessors_test.cc @@ -0,0 +1,444 @@ +/* + * 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 mini table accessors. + * + * Messages are created and mutated using generated code, and then + * accessed through reflective APIs exposed through mini table accessors. + */ + +#include "upb/mini_table_accessors.h" + +#include "gtest/gtest.h" +#include "google/protobuf/test_messages_proto2.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" +#include "upb/array.h" +#include "upb/mini_table.h" +#include "upb/test.upb.h" + +namespace { + +// Proto2 test messages field numbers used for reflective access. +const uint32_t kFieldOptionalInt32 = 1; +const uint32_t kFieldOptionalUInt32 = 3; +const uint32_t kFieldOptionalBool = 13; +const uint32_t kFieldOptionalString = 14; +const uint32_t kFieldOptionalNestedMessage = 18; +const uint32_t kFieldOptionalRepeatedInt32 = 31; +const uint32_t kFieldOptionalNestedMessageA = 1; +const uint32_t kFieldOptionalOneOfUInt32 = 111; +const uint32_t kFieldOptionalOneOfString = 113; + +const uint32_t kFieldProto3OptionalInt64 = 2; +const uint32_t kFieldProto3OptionalUInt64 = 4; + +const char kTestStr1[] = "Hello1"; +const char kTestStr2[] = "Hello2"; +const int32_t kTestInt32 = 567; +const int32_t kTestUInt32 = 0xF1234567; +const uint64_t kTestUInt64 = 0xFEDCBAFF87654321; + +const upb_MiniTable_Field* find_proto3_field(int field_number) { + return upb_MiniTable_FindFieldByNumber( + &protobuf_test_messages_proto3_TestAllTypesProto3_msginit, field_number); +} + +const upb_MiniTable_Field* find_proto2_field(int field_number) { + return upb_MiniTable_FindFieldByNumber( + &protobuf_test_messages_proto2_TestAllTypesProto2_msginit, field_number); +} + +TEST(GeneratedCode, HazzersProto2) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + + // Scalar/Boolean. + const upb_MiniTable_Field* optional_bool_field = + find_proto2_field(kFieldOptionalBool); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_bool_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_bool(msg, true); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_bool_field)); + upb_MiniTable_ClearField(msg, optional_bool_field); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_bool_field)); + EXPECT_EQ( + false, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_bool(msg)); + + // String. + const upb_MiniTable_Field* optional_string_field = + find_proto2_field(kFieldOptionalString); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_string( + msg, upb_StringView_FromString(kTestStr1)); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_string_field)); + EXPECT_EQ( + strlen(kTestStr1), + protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg) + .size); + upb_MiniTable_ClearField(msg, optional_string_field); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field)); + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg) + .size); + + // Message. + const upb_MiniTable_Field* optional_message_field = + find_proto2_field(kFieldOptionalNestedMessage); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_mutable_optional_nested_message( + msg, arena); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_message_field)); + upb_MiniTable_ClearField(msg, optional_message_field); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field)); + EXPECT_EQ( + true, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message( + msg) == nullptr); + + // One of. + const upb_MiniTable_Field* optional_oneof_uint32_field = + find_proto2_field(kFieldOptionalOneOfUInt32); + const upb_MiniTable_Field* optional_oneof_string_field = + find_proto2_field(kFieldOptionalOneOfString); + + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_string_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_oneof_uint32(msg, 123); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_string_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_set_oneof_string( + msg, upb_StringView_FromString(kTestStr1)); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_oneof_string_field)); + upb_MiniTable_ClearField(msg, optional_oneof_uint32_field); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_oneof_string_field)); + upb_MiniTable_ClearField(msg, optional_oneof_string_field); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_uint32_field)); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_oneof_string_field)); + + 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); + + const upb_MiniTable_Field* optional_int32_field = + find_proto2_field(kFieldOptionalInt32); + + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg)); + + EXPECT_EQ(0, upb_MiniTable_GetInt32(msg, optional_int32_field)); + upb_MiniTable_SetInt32(msg, optional_int32_field, kTestInt32); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_int32_field)); + EXPECT_EQ(kTestInt32, upb_MiniTable_GetInt32(msg, optional_int32_field)); + EXPECT_EQ( + kTestInt32, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_int32(msg)); + + const upb_MiniTable_Field* optional_uint32_field = + find_proto2_field(kFieldOptionalUInt32); + + EXPECT_EQ( + 0, protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg)); + EXPECT_EQ(0, upb_MiniTable_GetUInt32(msg, optional_uint32_field)); + upb_MiniTable_SetUInt32(msg, optional_uint32_field, kTestUInt32); + EXPECT_EQ(kTestUInt32, upb_MiniTable_GetUInt32(msg, optional_uint32_field)); + EXPECT_EQ( + kTestUInt32, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_uint32(msg)); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, ScalarProto3) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto3_TestAllTypesProto3* msg = + protobuf_test_messages_proto3_TestAllTypesProto3_new(arena); + + const upb_MiniTable_Field* optional_int64_field = + find_proto3_field(kFieldProto3OptionalInt64); + const upb_MiniTable_Field* optional_uint64_field = + find_proto3_field(kFieldProto3OptionalUInt64); + + EXPECT_EQ( + 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg)); + upb_MiniTable_SetInt64(msg, optional_int64_field, -1); + EXPECT_EQ( + -1, protobuf_test_messages_proto3_TestAllTypesProto3_optional_int64(msg)); + EXPECT_EQ(-1, upb_MiniTable_GetInt64(msg, optional_int64_field)); + + EXPECT_EQ( + 0, protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg)); + upb_MiniTable_SetUInt64(msg, optional_uint64_field, kTestUInt64); + EXPECT_EQ( + kTestUInt64, + protobuf_test_messages_proto3_TestAllTypesProto3_optional_uint64(msg)); + EXPECT_EQ(kTestUInt64, upb_MiniTable_GetUInt64(msg, optional_uint64_field)); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, Strings) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + + const upb_MiniTable_Field* optional_string_field = + find_proto2_field(kFieldOptionalString); + + // Test default. + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field)); + // Test read after write using C. + protobuf_test_messages_proto2_TestAllTypesProto2_set_optional_string( + msg, upb_StringView_FromString(kTestStr1)); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_string_field)); + upb_StringView value = upb_MiniTable_GetString(msg, optional_string_field); + std::string read_value = std::string(value.data, value.size); + EXPECT_EQ(kTestStr1, read_value); + // Clear. + upb_MiniTable_ClearField(msg, optional_string_field); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_string_field)); + EXPECT_EQ( + false, + protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string( + msg)); + upb_MiniTable_SetString(msg, optional_string_field, + upb_StringView_FromString(kTestStr2)); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_string_field)); + EXPECT_EQ( + true, + protobuf_test_messages_proto2_TestAllTypesProto2_has_optional_string( + msg)); + value = protobuf_test_messages_proto2_TestAllTypesProto2_optional_string(msg); + read_value = std::string(value.data, value.size); + EXPECT_EQ(kTestStr2, read_value); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, SubMessage) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + + const upb_MiniTable_Field* optional_message_field = + find_proto2_field(kFieldOptionalNestedMessage); + + const upb_Message* test_message = + upb_MiniTable_GetMessage(msg, optional_message_field); + EXPECT_EQ(NULL, test_message); + + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field)); + + // Get mutable using C API. + protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage* nested_message = + protobuf_test_messages_proto2_TestAllTypesProto2_mutable_optional_nested_message( + msg, arena); + EXPECT_EQ(true, nested_message != nullptr); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_message_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_set_a( + nested_message, 5); + + // Read back using mini table API. + const upb_Message* sub_message = + upb_MiniTable_GetMessage(msg, optional_message_field); + EXPECT_EQ(true, sub_message != NULL); + + const upb_MiniTable_Field* nested_message_a_field = + upb_MiniTable_FindFieldByNumber( + &protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_msginit, + kFieldOptionalNestedMessageA); + EXPECT_EQ(5, upb_MiniTable_GetInt32(sub_message, nested_message_a_field)); + + upb_MiniTable_ClearField(msg, optional_message_field); + EXPECT_EQ( + NULL, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message( + msg)); + EXPECT_EQ(false, upb_MiniTable_HasField(msg, optional_message_field)); + + upb_Message* new_nested_message = + protobuf_test_messages_proto2_TestAllTypesProto2_NestedMessage_new(arena); + upb_MiniTable_SetInt32(new_nested_message, nested_message_a_field, 123); + upb_MiniTable_SetMessage(msg, optional_message_field, new_nested_message); + + upb_Message* mutable_message = upb_MiniTable_GetMutableMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msginit, + optional_message_field, arena); + EXPECT_EQ( + true, + protobuf_test_messages_proto2_TestAllTypesProto2_optional_nested_message( + msg) != NULL); + EXPECT_EQ(true, upb_MiniTable_HasField(msg, optional_message_field)); + EXPECT_EQ(123, + upb_MiniTable_GetInt32(mutable_message, nested_message_a_field)); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, RepeatedScalar) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + + const upb_MiniTable_Field* repeated_int32_field = + find_proto2_field(kFieldOptionalRepeatedInt32); + + size_t len; + const int32_t* arr = + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, + &len); + // Test Get/Set Array values, validate with C API. + EXPECT_EQ(0, len); + EXPECT_EQ(NULL, arr); + EXPECT_EQ(NULL, upb_MiniTable_GetArray(msg, repeated_int32_field)); + protobuf_test_messages_proto2_TestAllTypesProto2_resize_repeated_int32( + msg, 10, arena); + int32_t* mutable_values = + protobuf_test_messages_proto2_TestAllTypesProto2_mutable_repeated_int32( + msg, &len); + mutable_values[5] = 123; + const upb_Array* readonly_arr = + upb_MiniTable_GetArray(msg, repeated_int32_field); + EXPECT_EQ(123, upb_Array_Get(readonly_arr, 5).int32_val); + + upb_MessageValue new_value; + new_value.int32_val = 567; + upb_Array* mutable_array = + upb_MiniTable_GetMutableArray(msg, repeated_int32_field); + upb_Array_Set(mutable_array, 5, new_value); + EXPECT_EQ(new_value.int32_val, + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32( + msg, &len)[5]); + + // Test resize. + bool result = upb_Array_Resize(mutable_array, 20, arena); + EXPECT_EQ(true, result); + upb_Array_Set(mutable_array, 19, new_value); + EXPECT_EQ(new_value.int32_val, + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32( + msg, &len)[19]); + upb_Array_Resize(mutable_array, 0, arena); + const int32_t* zero_length_array = + protobuf_test_messages_proto2_TestAllTypesProto2_repeated_int32(msg, + &len); + EXPECT_EQ(0, len); + EXPECT_EQ(true, zero_length_array != NULL); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, GetMutableMessage) { + upb_Arena* arena = upb_Arena_New(); + protobuf_test_messages_proto2_TestAllTypesProto2* msg = + protobuf_test_messages_proto2_TestAllTypesProto2_new(arena); + // Message. + const upb_MiniTable_Field* optional_message_field = + find_proto2_field(kFieldOptionalNestedMessage); + upb_Message* msg1 = upb_MiniTable_GetMutableMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msginit, + optional_message_field, arena); + upb_Message* msg2 = upb_MiniTable_GetMutableMessage( + msg, &protobuf_test_messages_proto2_TestAllTypesProto2_msginit, + optional_message_field, arena); + // Verify that newly constructed sub message is stored in msg. + EXPECT_EQ(msg1, msg2); + + upb_Arena_Free(arena); +} + +TEST(GeneratedCode, Extensions) { + upb_Arena* arena = upb_Arena_New(); + upb_test_ModelWithExtensions* msg = upb_test_ModelWithExtensions_new(arena); + upb_test_ModelWithExtensions_set_random_int32(msg, 10); + upb_test_ModelWithExtensions_set_random_name( + msg, upb_StringView_FromString("Hello")); + + upb_test_ModelExtension1* extension1 = upb_test_ModelExtension1_new(arena); + upb_test_ModelExtension1_set_str(extension1, + upb_StringView_FromString("World")); + + upb_test_ModelExtension2* extension2 = upb_test_ModelExtension2_new(arena); + upb_test_ModelExtension2_set_i(extension2, 5); + + upb_test_ModelExtension1_set_model_ext(msg, extension1, arena); + upb_test_ModelExtension2_set_model_ext(msg, extension2, arena); + + size_t serialized_size; + char* serialized = + upb_test_ModelWithExtensions_serialize(msg, arena, &serialized_size); + + // Test known GetExtension + const upb_Message_Extension* upb_ext2; + upb_GetExtension_Status promote_status = upb_MiniTable_GetOrPromoteExtension( + msg, &upb_test_ModelExtension2_model_ext_ext, 0, arena, &upb_ext2); + + upb_test_ModelExtension2* ext2 = + (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(5, upb_test_ModelExtension2_i(ext2)); + + upb_test_EmptyMessageWithExtensions* base_msg = + upb_test_EmptyMessageWithExtensions_parse(serialized, serialized_size, + arena); + + // Get unknown extension bytes before promotion. + const char* extension_data; + size_t len; + upb_GetExtensionAsBytes_Status status = status = + upb_MiniTable_GetExtensionAsBytes(base_msg, + &upb_test_ModelExtension2_model_ext_ext, + 0, arena, &extension_data, &len); + EXPECT_EQ(kUpb_GetExtensionAsBytes_Ok, status); + EXPECT_EQ(0x48, extension_data[0]); + EXPECT_EQ(5, extension_data[1]); + + // Test unknown GetExtension. + promote_status = upb_MiniTable_GetOrPromoteExtension( + base_msg, &upb_test_ModelExtension2_model_ext_ext, 0, arena, &upb_ext2); + + ext2 = (upb_test_ModelExtension2*)upb_ext2->data.ptr; + EXPECT_EQ(kUpb_GetExtension_Ok, promote_status); + EXPECT_EQ(5, upb_test_ModelExtension2_i(ext2)); + + // Get unknown extension bytes after promotion. + status = upb_MiniTable_GetExtensionAsBytes( + base_msg, &upb_test_ModelExtension2_model_ext_ext, 0, arena, + &extension_data, &len); + EXPECT_EQ(kUpb_GetExtensionAsBytes_Ok, status); + EXPECT_EQ(0x48, extension_data[0]); + EXPECT_EQ(5, extension_data[1]); + + upb_Arena_Free(arena); +} + +} // namespace diff --git a/third_party/upb/upb/mini_table_test.cc b/third_party/upb/upb/mini_table_test.cc index 624bb790c6e..bb0d6d4ef5c 100644 --- a/third_party/upb/upb/mini_table_test.cc +++ b/third_party/upb/upb/mini_table_test.cc @@ -180,3 +180,67 @@ TEST(MiniTablePlatformIndependentTest, IsTypePackable) { static_cast(i))); } } + +TEST(MiniTableEnumTest, Enum) { + upb::Arena arena; + upb::MtDataEncoder e; + + e.StartEnum(); + absl::flat_hash_set values; + for (int i = 0; i < 256; i++) { + values.insert(i * 2); + e.PutEnumValue(i * 2); + } + e.EndEnum(); + + upb::Status status; + upb_MiniTable_Enum* table = upb_MiniTable_BuildEnum( + e.data().data(), e.data().size(), arena.ptr(), status.ptr()); + ASSERT_NE(nullptr, table) << status.error_message(); + + for (int i = 0; i < UINT16_MAX; i++) { + EXPECT_EQ(values.contains(i), upb_MiniTable_Enum_CheckValue(table, i)) << i; + } +} + +TEST(MiniTableEnumTest, PositiveAndNegative) { + upb::Arena arena; + upb::MtDataEncoder e; + + e.StartEnum(); + absl::flat_hash_set values; + for (int i = 0; i < 100; i++) { + values.insert(i); + e.PutEnumValue(i); + } + for (int i = 100; i > 0; i--) { + values.insert(-i); + e.PutEnumValue(-i); + } + e.EndEnum(); + + upb::Status status; + upb_MiniTable_Enum* table = upb_MiniTable_BuildEnum( + e.data().data(), e.data().size(), arena.ptr(), status.ptr()); + ASSERT_NE(nullptr, table) << status.error_message(); + + for (int i = -UINT16_MAX; i < UINT16_MAX; i++) { + EXPECT_EQ(values.contains(i), upb_MiniTable_Enum_CheckValue(table, i)) << i; + } +} + +TEST_P(MiniTableTest, Extendible) { + upb::Arena arena; + upb::MtDataEncoder e; + ASSERT_TRUE(e.StartMessage(kUpb_MessageModifier_IsExtendable)); + int count = 0; + for (int i = kUpb_FieldType_Double; i < kUpb_FieldType_SInt64; i++) { + ASSERT_TRUE(e.PutField(static_cast(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(kUpb_ExtMode_Extendable, table->ext & kUpb_ExtMode_Extendable); +} diff --git a/third_party/upb/upb/msg.c b/third_party/upb/upb/msg.c index b8a629467d8..036c62199d3 100644 --- a/third_party/upb/upb/msg.c +++ b/third_party/upb/upb/msg.c @@ -27,9 +27,9 @@ #include "upb/msg.h" +#include "upb/internal/table.h" #include "upb/msg_internal.h" #include "upb/port_def.inc" -#include "upb/table_internal.h" /** upb_Message ***************************************************************/ @@ -153,7 +153,7 @@ void _upb_Message_Clearext(upb_Message* msg, } } -upb_Message_Extension* _upb_Message_Getorcreateext( +upb_Message_Extension* _upb_Message_GetOrCreateExtension( upb_Message* msg, const upb_MiniTable_Extension* e, upb_Arena* arena) { upb_Message_Extension* ext = (upb_Message_Extension*)_upb_Message_Getext(msg, e); @@ -366,63 +366,3 @@ bool _upb_mapsorter_pushmap(_upb_mapsorter* s, upb_FieldType 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/third_party/upb/upb/msg.h b/third_party/upb/upb/msg.h index c984b137b1e..5c1e8e89317 100644 --- a/third_party/upb/upb/msg.h +++ b/third_party/upb/upb/msg.h @@ -38,14 +38,14 @@ #include +// TODO(b/232091617): Remove this and fix everything that breaks as a result. +#include "upb/extension_registry.h" #include "upb/upb.h" #ifdef __cplusplus extern "C" { #endif -/** upb_Message ***************************************************************/ - typedef void upb_Message; /* For users these are opaque. They can be obtained from @@ -64,49 +64,6 @@ const char* upb_Message_GetUnknown(const upb_Message* msg, size_t* len); /* Returns the number of extensions present in this message. */ size_t upb_Message_ExtensionCount(const upb_Message* msg); -/** upb_ExtensionRegistry *****************************************************/ - -/* 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. - * - * 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. - * - * 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. - */ - -struct upb_ExtensionRegistry; -typedef struct upb_ExtensionRegistry upb_ExtensionRegistry; - -/* 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" */ #endif diff --git a/third_party/upb/upb/msg_internal.h b/third_party/upb/upb/msg_internal.h index 39adfdb9d4e..4f5c4797c5d 100644 --- a/third_party/upb/upb/msg_internal.h +++ b/third_party/upb/upb/msg_internal.h @@ -39,8 +39,9 @@ #include #include +#include "upb/extension_registry.h" +#include "upb/internal/table.h" #include "upb/msg.h" -#include "upb/table_internal.h" #include "upb/upb.h" /* Must be last. */ @@ -139,18 +140,6 @@ typedef struct { 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; @@ -172,7 +161,7 @@ typedef enum { * message MessageSet { * repeated group Item = 1 { * required int32 type_id = 2; - * required string message = 3; + * required bytes message = 3; * } * } */ @@ -287,7 +276,7 @@ UPB_INLINE size_t upb_msg_sizeof(const upb_MiniTable* l) { 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); + void* mem = upb_Arena_Malloc(a, size + sizeof(upb_Message_Internal)); upb_Message* msg; if (UPB_UNLIKELY(!mem)) return NULL; msg = UPB_PTR_AT(mem, sizeof(upb_Message_Internal), upb_Message); @@ -336,7 +325,7 @@ typedef struct { /* 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_Extension* _upb_Message_GetOrCreateExtension( upb_Message* msg, const upb_MiniTable_Extension* ext, upb_Arena* arena); /* Returns an array of extensions for this message. Note: the array is @@ -679,15 +668,31 @@ UPB_INLINE void* _upb_map_next(const upb_Map* map, size_t* iter) { 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) { +typedef enum { + // LINT.IfChange + _kUpb_MapInsertStatus_Inserted = 0, + _kUpb_MapInsertStatus_Replaced = 1, + _kUpb_MapInsertStatus_OutOfMemory = 2, + // LINT.ThenChange(//depot/google3/third_party/upb/upb/map.h) +} _upb_MapInsertStatus; + +UPB_INLINE _upb_MapInsertStatus _upb_Map_Insert(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; + if (!_upb_map_tovalue(val, val_size, &tabval, a)) { + return _kUpb_MapInsertStatus_OutOfMemory; + } /* 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); + bool removed = + upb_strtable_remove2(&map->table, strkey.data, strkey.size, NULL); + if (!upb_strtable_insert(&map->table, strkey.data, strkey.size, tabval, a)) { + return _kUpb_MapInsertStatus_OutOfMemory; + } + return removed ? _kUpb_MapInsertStatus_Replaced + : _kUpb_MapInsertStatus_Inserted; } UPB_INLINE bool _upb_Map_Delete(upb_Map* map, const void* key, @@ -729,7 +734,8 @@ UPB_INLINE bool _upb_msg_map_set(upb_Message* msg, size_t ofs, const void* key, if (!*map) { *map = _upb_Map_New(arena, key_size, val_size); } - return _upb_Map_Set(*map, key, key_size, val, val_size, arena); + return _upb_Map_Insert(*map, key, key_size, val, val_size, arena) != + _kUpb_MapInsertStatus_OutOfMemory; } UPB_INLINE bool _upb_msg_map_delete(upb_Message* msg, size_t ofs, diff --git a/third_party/upb/upb/msg_test.cc b/third_party/upb/upb/msg_test.cc index 2d1f8e991bb..d46e29fd96b 100644 --- a/third_party/upb/upb/msg_test.cc +++ b/third_party/upb/upb/msg_test.cc @@ -27,7 +27,7 @@ #include "gmock/gmock.h" #include "gtest/gtest.h" -#include "src/google/protobuf/test_messages_proto3.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" #include "upb/def.hpp" #include "upb/json_decode.h" #include "upb/json_encode.h" @@ -57,8 +57,8 @@ TEST(MessageTest, Extensions) { // 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())); + upb::DefPool defpool; + upb::MessageDefPtr m(upb_test_TestExtensions_getmsgdef(defpool.ptr())); EXPECT_TRUE(m.ptr() != nullptr); std::string json = R"json( @@ -70,7 +70,7 @@ TEST(MessageTest, Extensions) { )json"; upb::Status status; EXPECT_TRUE(upb_JsonDecode(json.data(), json.size(), ext_msg, m.ptr(), - symtab.ptr(), 0, arena.ptr(), status.ptr())) + defpool.ptr(), 0, arena.ptr(), status.ptr())) << status.error_message(); VerifyMessage(ext_msg); @@ -83,25 +83,26 @@ TEST(MessageTest, Extensions) { ASSERT_GE(size, 0); upb_test_TestExtensions* ext_msg2 = upb_test_TestExtensions_parse_ex( - serialized, size, upb_DefPool_ExtensionRegistry(symtab.ptr()), 0, + serialized, size, upb_DefPool_ExtensionRegistry(defpool.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()); + upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, NULL, 0, status.ptr()); char* json_buf = static_cast(upb_Arena_Malloc(arena.ptr(), json_size + 1)); - upb_JsonEncode(ext_msg, m.ptr(), symtab.ptr(), 0, json_buf, json_size + 1, + upb_JsonEncode(ext_msg, m.ptr(), defpool.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())) + defpool.ptr(), 0, arena.ptr(), status.ptr())) << status.error_message(); VerifyMessage(ext_msg3); } void VerifyMessageSet(const upb_test_TestMessageSet* mset_msg) { + ASSERT_TRUE(mset_msg != nullptr); bool has = upb_test_MessageSetMember_has_message_set_extension(mset_msg); EXPECT_TRUE(has); if (!has) return; @@ -118,8 +119,8 @@ TEST(MessageTest, MessageSet) { EXPECT_FALSE(upb_test_MessageSetMember_has_message_set_extension(ext_msg)); - upb::SymbolTable symtab; - upb::MessageDefPtr m(upb_test_TestMessageSet_getmsgdef(symtab.ptr())); + upb::DefPool defpool; + upb::MessageDefPtr m(upb_test_TestMessageSet_getmsgdef(defpool.ptr())); EXPECT_TRUE(m.ptr() != nullptr); std::string json = R"json( @@ -129,7 +130,7 @@ TEST(MessageTest, MessageSet) { )json"; upb::Status status; EXPECT_TRUE(upb_JsonDecode(json.data(), json.size(), ext_msg, m.ptr(), - symtab.ptr(), 0, arena.ptr(), status.ptr())) + defpool.ptr(), 0, arena.ptr(), status.ptr())) << status.error_message(); VerifyMessageSet(ext_msg); @@ -142,24 +143,85 @@ TEST(MessageTest, MessageSet) { ASSERT_GE(size, 0); upb_test_TestMessageSet* ext_msg2 = upb_test_TestMessageSet_parse_ex( - serialized, size, upb_DefPool_ExtensionRegistry(symtab.ptr()), 0, + serialized, size, upb_DefPool_ExtensionRegistry(defpool.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()); + upb_JsonEncode(ext_msg, m.ptr(), defpool.ptr(), 0, NULL, 0, status.ptr()); char* json_buf = static_cast(upb_Arena_Malloc(arena.ptr(), json_size + 1)); - upb_JsonEncode(ext_msg, m.ptr(), symtab.ptr(), 0, json_buf, json_size + 1, + upb_JsonEncode(ext_msg, m.ptr(), defpool.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())) + defpool.ptr(), 0, arena.ptr(), status.ptr())) << status.error_message(); VerifyMessageSet(ext_msg3); } +TEST(MessageTest, UnknownMessageSet) { + static const char data[] = "ABCDE"; + upb_StringView data_view = upb_StringView_FromString(data); + upb::Arena arena; + upb_test_FakeMessageSet* fake = upb_test_FakeMessageSet_new(arena.ptr()); + + // Add a MessageSet item that is unknown (there is no matching extension in + // the .proto file) + upb_test_FakeMessageSet_Item* item = + upb_test_FakeMessageSet_add_item(fake, arena.ptr()); + upb_test_FakeMessageSet_Item_set_type_id(item, 12345); + upb_test_FakeMessageSet_Item_set_message(item, data_view); + + // Set unknown fields inside the message set to test that we can skip them. + upb_test_FakeMessageSet_Item_set_unknown_varint(item, 12345678); + upb_test_FakeMessageSet_Item_set_unknown_fixed32(item, 12345678); + upb_test_FakeMessageSet_Item_set_unknown_fixed64(item, 12345678); + upb_test_FakeMessageSet_Item_set_unknown_bytes(item, data_view); + upb_test_FakeMessageSet_Item_mutable_unknowngroup(item, arena.ptr()); + + // Round trip through a true MessageSet where this item_id is unknown. + size_t size; + char* serialized = + upb_test_FakeMessageSet_serialize(fake, arena.ptr(), &size); + ASSERT_TRUE(serialized != nullptr); + ASSERT_GE(size, 0); + + upb::DefPool defpool; + upb::MessageDefPtr m(upb_test_TestMessageSet_getmsgdef(defpool.ptr())); + EXPECT_TRUE(m.ptr() != nullptr); + upb_test_TestMessageSet* message_set = upb_test_TestMessageSet_parse_ex( + serialized, size, upb_DefPool_ExtensionRegistry(defpool.ptr()), 0, + arena.ptr()); + ASSERT_TRUE(message_set != nullptr); + + char* serialized2 = + upb_test_TestMessageSet_serialize(message_set, arena.ptr(), &size); + ASSERT_TRUE(serialized2 != nullptr); + ASSERT_GE(size, 0); + + // Parse back into a fake MessageSet and verify that the unknown MessageSet + // item was preserved in full (both type_id and message). + upb_test_FakeMessageSet* fake2 = + upb_test_FakeMessageSet_parse(serialized2, size, arena.ptr()); + ASSERT_TRUE(fake2 != nullptr); + + const upb_test_FakeMessageSet_Item* const* items = + upb_test_FakeMessageSet_item(fake2, &size); + ASSERT_EQ(1, size); + EXPECT_EQ(12345, upb_test_FakeMessageSet_Item_type_id(items[0])); + EXPECT_TRUE(upb_StringView_IsEqual( + data_view, upb_test_FakeMessageSet_Item_message(items[0]))); + + // The non-MessageSet unknown fields should have been discarded. + EXPECT_FALSE(upb_test_FakeMessageSet_Item_has_unknown_varint(items[0])); + EXPECT_FALSE(upb_test_FakeMessageSet_Item_has_unknown_fixed32(items[0])); + EXPECT_FALSE(upb_test_FakeMessageSet_Item_has_unknown_fixed64(items[0])); + EXPECT_FALSE(upb_test_FakeMessageSet_Item_has_unknown_bytes(items[0])); + EXPECT_FALSE(upb_test_FakeMessageSet_Item_has_unknowngroup(items[0])); +} + TEST(MessageTest, Proto2Enum) { upb::Arena arena; upb_test_Proto2FakeEnumMessage* fake_msg = @@ -345,13 +407,13 @@ TEST(MessageTest, EncodeRequiredFields) { // 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); + test_msg, kUpb_EncodeOption_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); + test_msg, kUpb_EncodeOption_CheckRequired, arena.ptr(), &size); ASSERT_TRUE(serialized == nullptr); // Succeeds, all required fields are set. @@ -359,7 +421,7 @@ TEST(MessageTest, EncodeRequiredFields) { 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); + test_msg, kUpb_EncodeOption_CheckRequired, arena.ptr(), &size); ASSERT_TRUE(serialized != nullptr); } @@ -372,11 +434,11 @@ TEST(MessageTest, MaxRequiredFields) { // missing. size_t size; char* serialized = upb_test_TestMaxRequiredFields_serialize_ex( - test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size); + test_msg, kUpb_EncodeOption_CheckRequired, arena.ptr(), &size); ASSERT_TRUE(serialized == nullptr); - upb::SymbolTable symtab; - upb::MessageDefPtr m(upb_test_TestMaxRequiredFields_getmsgdef(symtab.ptr())); + upb::DefPool defpool; + upb::MessageDefPtr m(upb_test_TestMaxRequiredFields_getmsgdef(defpool.ptr())); upb_MessageValue val; val.int32_val = 1; for (int i = 1; i <= 61; i++) { @@ -387,7 +449,7 @@ TEST(MessageTest, MaxRequiredFields) { // Fails, field 63 still isn't set. serialized = upb_test_TestMaxRequiredFields_serialize_ex( - test_msg, kUpb_Encode_CheckRequired, arena.ptr(), &size); + test_msg, kUpb_EncodeOption_CheckRequired, arena.ptr(), &size); ASSERT_TRUE(serialized == nullptr); // Succeeds, all required fields are set. @@ -395,7 +457,7 @@ TEST(MessageTest, MaxRequiredFields) { 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); + test_msg, kUpb_EncodeOption_CheckRequired, arena.ptr(), &size); ASSERT_TRUE(serialized != nullptr); } diff --git a/third_party/upb/upb/msg_test.proto b/third_party/upb/upb/msg_test.proto index 1cdd84a3c28..237f1323811 100644 --- a/third_party/upb/upb/msg_test.proto +++ b/third_party/upb/upb/msg_test.proto @@ -25,11 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +// LINT: ALLOW_GROUPS + syntax = "proto2"; package upb_test; -import "src/google/protobuf/test_messages_proto3.proto"; +import "google/protobuf/test_messages_proto3.proto"; message TestExtensions { extensions 1000 to max; @@ -61,6 +63,18 @@ message MessageSetMember { } } +message FakeMessageSet { + repeated group Item = 1 { + optional int32 type_id = 2; + optional bytes message = 3; + optional int32 unknown_varint = 4; + optional fixed32 unknown_fixed32 = 5; + optional fixed64 unknown_fixed64 = 6; + optional bytes unknown_bytes = 7; + optional group UnknownGroup = 8 {} + } +} + message Proto2EnumMessage { enum Proto2TestEnum { ZERO = 0; diff --git a/third_party/upb/upb/port_def.inc b/third_party/upb/upb/port_def.inc index 2b240ff6e82..92e4bf24779 100644 --- a/third_party/upb/upb/port_def.inc +++ b/third_party/upb/upb/port_def.inc @@ -88,9 +88,10 @@ #define UPB_INLINE static #endif +#define UPB_MALLOC_ALIGN 8 #define UPB_ALIGN_UP(size, align) (((size) + (align) - 1) / (align) * (align)) #define UPB_ALIGN_DOWN(size, align) ((size) / (align) * (align)) -#define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, 16) +#define UPB_ALIGN_MALLOC(size) UPB_ALIGN_UP(size, UPB_MALLOC_ALIGN) #define UPB_ALIGN_OF(type) offsetof (struct { char c; type member; }, member) /* Hints to the compiler about likely/unlikely branches. */ diff --git a/third_party/upb/upb/port_undef.inc b/third_party/upb/upb/port_undef.inc index 3ef2d0dbcdb..1dff3d275d2 100644 --- a/third_party/upb/upb/port_undef.inc +++ b/third_party/upb/upb/port_undef.inc @@ -37,6 +37,7 @@ #undef UPB_ALIGN_DOWN #undef UPB_ALIGN_MALLOC #undef UPB_ALIGN_OF +#undef UPB_MALLOC_ALIGN #undef UPB_LIKELY #undef UPB_UNLIKELY #undef UPB_FORCEINLINE diff --git a/third_party/upb/upb/reflection.c b/third_party/upb/upb/reflection.c index a3a64d27802..43f884495fe 100644 --- a/third_party/upb/upb/reflection.c +++ b/third_party/upb/upb/reflection.c @@ -29,9 +29,9 @@ #include +#include "upb/internal/table.h" #include "upb/msg.h" #include "upb/port_def.inc" -#include "upb/table_internal.h" static size_t get_field_size(const upb_MiniTable_Field* f) { static unsigned char sizes[] = { @@ -58,37 +58,6 @@ static size_t get_field_size(const upb_MiniTable_Field* f) { return upb_IsRepeatedOrMap(f) ? sizeof(void*) : sizes[f->descriptortype]; } -/* Strings/bytes are special-cased in maps. */ -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_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_Message * *******************************************************************/ @@ -202,7 +171,7 @@ make: 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( + upb_Message_Extension* ext = _upb_Message_GetOrCreateExtension( msg, _upb_FieldDef_ExtensionMiniTable(f), a); if (!ext) return false; memcpy(&ext->data, &val, sizeof(val)); @@ -352,129 +321,3 @@ 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_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; } - -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); - memcpy(&ret, data + (i << lg2), 1 << lg2); - return ret; -} - -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_MessageValue val, upb_Arena* arena) { - if (!upb_Array_Resize(arr, arr->len + 1, arena)) { - return false; - } - upb_Array_Set(arr, arr->len - 1, val); - return true; -} - -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); -} - -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; -} - -/* - * 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; -} - -bool upb_Array_Resize(upb_Array* arr, size_t size, upb_Arena* arena) { - return _upb_Array_Resize(arr, size, arena); -} - -/** 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]); -} - -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); -} - -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_MessageValue key) { - return _upb_Map_Delete(map, &key, map->key_size); -} - -bool upb_MapIterator_Next(const upb_Map* map, size_t* iter) { - return _upb_map_next(map, iter); -} - -bool upb_MapIterator_Done(const upb_Map* map, size_t iter) { - upb_strtable_iter i; - 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_MessageValue upb_MapIterator_Key(const upb_Map* map, size_t iter) { - upb_strtable_iter i; - 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_MessageValue upb_MapIterator_Value(const upb_Map* map, size_t iter) { - upb_strtable_iter i; - 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_MapIterator_SetValue(upb_Map *map, size_t iter, upb_MessageValue - * value); */ diff --git a/third_party/upb/upb/reflection.h b/third_party/upb/upb/reflection.h index b892f66bfb5..6071fba6f5c 100644 --- a/third_party/upb/upb/reflection.h +++ b/third_party/upb/upb/reflection.h @@ -28,7 +28,9 @@ #ifndef UPB_REFLECTION_H_ #define UPB_REFLECTION_H_ +#include "upb/array.h" #include "upb/def.h" +#include "upb/map.h" #include "upb/msg.h" #include "upb/port_def.inc" #include "upb/upb.h" @@ -37,26 +39,6 @@ extern "C" { #endif -typedef union { - bool bool_val; - float float_val; - double double_val; - int32_t int32_val; - int64_t int64_val; - uint32_t uint32_val; - uint64_t uint64_val; - 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_Message* msg; - upb_Array* array; -} upb_MutableMessageValue; - upb_MessageValue upb_FieldDef_Default(const upb_FieldDef* f); /** upb_Message @@ -119,98 +101,6 @@ bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, bool upb_Message_DiscardUnknown(upb_Message* msg, const upb_MessageDef* m, int maxdepth); -/** 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_CType type); - -/* Returns the size of the array. */ -size_t upb_Array_Size(const upb_Array* arr); - -/* Returns the given element, which must be within the array's current size. */ -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_MessageValue val); - -/* Appends an element to the array. Returns false on allocation failure. */ -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); - -/** 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_CType key_type, upb_CType value_type); - -/* Returns the number of entries in the 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_MessageValue key, - upb_MessageValue* val); - -/* Removes all entries in the 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_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_MessageValue key); - -/* Map iteration: - * - * 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_MapIterator_SetValue(map, iter, value2); - * } - */ - -/* Advances to the next entry. Returns false if no more entries are present. */ -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 - * 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_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_MapIterator_SetValue(upb_Map* map, size_t iter, - upb_MessageValue value); - #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/third_party/upb/upb/status.c b/third_party/upb/upb/status.c new file mode 100644 index 00000000000..c00b9c86b2f --- /dev/null +++ b/third_party/upb/upb/status.c @@ -0,0 +1,86 @@ +/* + * 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/status.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "upb/internal/upb.h" + +// Must be last. +#include "upb/port_def.inc" + +void upb_Status_Clear(upb_Status* status) { + if (!status) return; + status->ok = true; + status->msg[0] = '\0'; +} + +bool upb_Status_IsOk(const upb_Status* status) { return status->ok; } + +const char* upb_Status_ErrorMessage(const upb_Status* status) { + return status->msg; +} + +void upb_Status_SetErrorMessage(upb_Status* status, const char* msg) { + if (!status) return; + status->ok = false; + strncpy(status->msg, msg, _kUpb_Status_MaxMessage - 1); + status->msg[_kUpb_Status_MaxMessage - 1] = '\0'; +} + +void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...) { + va_list args; + va_start(args, fmt); + upb_Status_VSetErrorFormat(status, fmt, args); + va_end(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[_kUpb_Status_MaxMessage - 1] = '\0'; +} + +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[_kUpb_Status_MaxMessage - 1] = '\0'; +} diff --git a/third_party/upb/upb/status.h b/third_party/upb/upb/status.h new file mode 100644 index 00000000000..2c5c2a7f8be --- /dev/null +++ b/third_party/upb/upb/status.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_STATUS_H_ +#define UPB_STATUS_H_ + +#include +#include + +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +#define _kUpb_Status_MaxMessage 127 + +typedef struct { + bool ok; + char msg[_kUpb_Status_MaxMessage]; /* Error message; NULL-terminated. */ +} upb_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_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); + +#include "upb/port_undef.inc" + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* UPB_STATUS_H_ */ diff --git a/third_party/upb/upb/table.c b/third_party/upb/upb/table.c index 941f258411b..e8e55f7e340 100644 --- a/third_party/upb/upb/table.c +++ b/third_party/upb/upb/table.c @@ -31,9 +31,9 @@ * Implementation is heavily inspired by Lua's ltable.c. */ -#include +#include "upb/internal/table.h" -#include "upb/table_internal.h" +#include /* Must be last. */ #include "upb/port_def.inc" diff --git a/third_party/upb/upb/table_internal.h b/third_party/upb/upb/table_internal.h index 418f470c3f4..7ac8bf78f9c 100644 --- a/third_party/upb/upb/table_internal.h +++ b/third_party/upb/upb/table_internal.h @@ -25,361 +25,12 @@ * 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 -#include - -#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 +// TODO(b/232091617): Delete this entire header which currently exists only for +// temporary backwards compatibility. -#include "upb/port_undef.inc" +#include "upb/internal/table.h" #endif /* UPB_TABLE_H_ */ diff --git a/third_party/upb/upb/test.proto b/third_party/upb/upb/test.proto index f4b94b4032a..d4e6b84488b 100644 --- a/third_party/upb/upb/test.proto +++ b/third_party/upb/upb/test.proto @@ -46,3 +46,29 @@ message HelloRequest { optional uint32 random_name_c9 = 31; optional string version = 32; } + +message EmptyMessageWithExtensions { + // Reserved for unknown fields/extensions test. + reserved 1000 to max; +} + +message ModelWithExtensions { + optional int32 random_int32 = 3; + optional string random_name = 4; + // Reserved for unknown fields/extensions test. + extensions 1000 to max; +} + +message ModelExtension1 { + extend ModelWithExtensions { + optional ModelExtension1 model_ext = 1547; + } + optional string str = 25; +} + +message ModelExtension2 { + extend ModelWithExtensions { + optional ModelExtension2 model_ext = 4135; + } + optional int32 i = 9; +} diff --git a/third_party/upb/upb/test_cpp.cc b/third_party/upb/upb/test_cpp.cc index 29021cbc00a..4d4aec6253f 100644 --- a/third_party/upb/upb/test_cpp.cc +++ b/third_party/upb/upb/test_cpp.cc @@ -50,8 +50,8 @@ #include "upb/port_def.inc" TEST(Cpp, Iteration) { - upb::SymbolTable symtab; - upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr())); + upb::DefPool defpool; + upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(defpool.ptr())); // Test range-based for on both fields and oneofs (with the iterator adaptor). int field_count = 0; @@ -131,17 +131,17 @@ TEST(Cpp, InlinedArena) { } TEST(Cpp, Default) { - upb::SymbolTable symtab; + upb::DefPool defpool; upb::Arena arena; - upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(symtab.ptr())); + upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(defpool.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::DefPool defpool; + upb::MessageDefPtr md(upb_test_TestMessage_getmsgdef(defpool.ptr())); upb::FieldDefPtr i32_f = md.FindFieldByName("i32"); upb::FieldDefPtr str_f = md.FindFieldByName("str"); ASSERT_TRUE(i32_f); @@ -152,9 +152,9 @@ TEST(Cpp, JsonNull) { } TEST(Cpp, TimestampEncoder) { - upb::SymbolTable symtab; + upb::DefPool defpool; upb::Arena arena; - upb::MessageDefPtr md(google_protobuf_Timestamp_getmsgdef(symtab.ptr())); + upb::MessageDefPtr md(google_protobuf_Timestamp_getmsgdef(defpool.ptr())); google_protobuf_Timestamp* timestamp_upb = google_protobuf_Timestamp_new(arena.ptr()); google_protobuf_Timestamp* timestamp_upb_decoded = diff --git a/third_party/upb/upb/test_generated_code.cc b/third_party/upb/upb/test_generated_code.cc index 7e36729d432..b74b148aba7 100644 --- a/third_party/upb/upb/test_generated_code.cc +++ b/third_party/upb/upb/test_generated_code.cc @@ -31,11 +31,14 @@ */ #include "gtest/gtest.h" -#include "src/google/protobuf/test_messages_proto2.upb.h" -#include "src/google/protobuf/test_messages_proto3.upb.h" +#include "google/protobuf/test_messages_proto2.upb.h" +#include "google/protobuf/test_messages_proto3.upb.h" #include "upb/test.upb.h" #include "upb/upb.hpp" +// Must be last. +#include "upb/port_def.inc" + #if !defined(MIN) #define MIN(x, y) ((x) < (y) ? (x) : (y)) #endif @@ -962,16 +965,17 @@ TEST(GeneratedCode, ArenaDecode) { TEST(GeneratedCode, ArenaUnaligned) { char buf1[1024]; // Force the pointer to be unaligned. - char* unaligned_buf_ptr = (char*)((uintptr_t)buf1 | 7); + uintptr_t low_bits = UPB_MALLOC_ALIGN - 1; + char* unaligned_buf_ptr = (char*)((uintptr_t)buf1 | low_bits); upb_Arena* arena = upb_Arena_Init( unaligned_buf_ptr, &buf1[sizeof(buf1)] - unaligned_buf_ptr, NULL); char* mem = static_cast(upb_Arena_Malloc(arena, 5)); - EXPECT_EQ(0, reinterpret_cast(mem) & 15); + EXPECT_EQ(0, reinterpret_cast(mem) & low_bits); 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(upb_Arena_Malloc(arena, 5)); - EXPECT_EQ(0, reinterpret_cast(mem) & 15); + EXPECT_EQ(0, reinterpret_cast(mem) & low_bits); upb_Arena_Free(arena); } diff --git a/third_party/upb/upb/test_table.cc b/third_party/upb/upb/test_table.cc index 2c368f839cf..ddb129a38e7 100644 --- a/third_party/upb/upb/test_table.cc +++ b/third_party/upb/upb/test_table.cc @@ -39,7 +39,7 @@ #include #include "gtest/gtest.h" -#include "upb/table_internal.h" +#include "upb/internal/table.h" #include "upb/upb.hpp" // Must be last. diff --git a/third_party/upb/upb/text_encode.c b/third_party/upb/upb/text_encode.c index 9612375dba7..dfb213f2bba 100644 --- a/third_party/upb/upb/text_encode.c +++ b/third_party/upb/upb/text_encode.c @@ -34,8 +34,9 @@ #include #include +#include "upb/internal/upb.h" +#include "upb/internal/vsnprintf_compat.h" #include "upb/reflection.h" -#include "upb/upb_internal.h" // Must be last. #include "upb/port_def.inc" @@ -76,7 +77,7 @@ static void txtenc_printf(txtenc* e, const char* fmt, ...) { va_list args; va_start(args, fmt); - n = vsnprintf(e->ptr, have, fmt, args); + n = _upb_vsnprintf(e->ptr, have, fmt, args); va_end(args); if (UPB_LIKELY(have > n)) { diff --git a/third_party/upb/upb/upb.c b/third_party/upb/upb/upb.c index 55730bbe820..08ae9647773 100644 --- a/third_party/upb/upb/upb.c +++ b/third_party/upb/upb/upb.c @@ -25,6 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "upb/internal/upb.h" + #include #include #include @@ -34,300 +36,12 @@ #include #include -#include "upb/upb_internal.h" +#include "upb/arena.h" +#include "upb/status.h" // Must be last. #include "upb/port_def.inc" -/* upb_Status *****************************************************************/ - -void upb_Status_Clear(upb_Status* status) { - if (!status) return; - status->ok = true; - status->msg[0] = '\0'; -} - -bool upb_Status_IsOk(const upb_Status* status) { return status->ok; } - -const char* upb_Status_ErrorMessage(const upb_Status* status) { - return status->msg; -} - -void upb_Status_SetErrorMessage(upb_Status* status, const char* msg) { - if (!status) return; - status->ok = false; - strncpy(status->msg, msg, _kUpb_Status_MaxMessage - 1); - status->msg[_kUpb_Status_MaxMessage - 1] = '\0'; -} - -void upb_Status_SetErrorFormat(upb_Status* status, const char* fmt, ...) { - va_list args; - va_start(args, fmt); - upb_Status_VSetErrorFormat(status, fmt, args); - va_end(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[_kUpb_Status_MaxMessage - 1] = '\0'; -} - -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[_kUpb_Status_MaxMessage - 1] = '\0'; -} - -/* upb_alloc ******************************************************************/ - -static void* upb_global_allocfunc(upb_alloc* alloc, void* ptr, size_t oldsize, - size_t size) { - UPB_UNUSED(alloc); - UPB_UNUSED(oldsize); - if (size == 0) { - free(ptr); - return NULL; - } else { - return realloc(ptr, size); - } -} - -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 ******************************************************************/ - -/* Be conservative and choose 16 in case anyone is using SSE. */ - -struct mem_block { - struct mem_block* next; - uint32_t size; - uint32_t cleanups; - /* Data follows. */ -}; - -typedef struct cleanup_ent { - 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) { - /* 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; - a->parent = next->parent; - a = next; - } - return a; -} - -static void upb_Arena_addblock(upb_Arena* a, upb_Arena* root, void* ptr, - size_t size) { - mem_block* block = ptr; - - /* The block is for arena |a|, but should appear in the freelist of |root|. */ - block->next = root->freelist; - block->size = (uint32_t)size; - block->cleanups = 0; - root->freelist = block; - a->last_size = block->size; - if (!root->freelist_tail) root->freelist_tail = block; - - a->head.ptr = UPB_PTR_AT(block, memblock_reserve, char); - a->head.end = UPB_PTR_AT(block, size, char); - 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); - size_t block_size = UPB_MAX(size, a->last_size * 2) + memblock_reserve; - mem_block* block = upb_malloc(root->block_alloc, block_size); - - if (!block) return false; - 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); -} - -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); -} - -/* 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; - - /* We need to malloc the initial block. */ - n = first_block_overhead + 256; - if (!alloc || !(mem = upb_malloc(alloc, n))) { - return NULL; - } - - a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena); - n -= sizeof(*a); - - 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); - - return 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)); - - if (UPB_UNLIKELY(n < sizeof(upb_Arena))) { - return arena_initslow(mem, n, alloc); - } - - a = UPB_PTR_AT(mem, n - sizeof(*a), upb_Arena); - - a->head.alloc.func = &upb_Arena_doalloc; - a->block_alloc = alloc; - a->parent = a; - a->refcount = 1; - a->last_size = UPB_MAX(128, n); - a->head.ptr = mem; - a->head.end = UPB_PTR_AT(mem, n - sizeof(*a), char); - a->freelist = NULL; - a->cleanup_metadata = upb_cleanup_metadata(NULL, true); - - return a; -} - -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; - - if (block->cleanups > 0) { - cleanup_ent* end = UPB_PTR_AT(block, block->size, void); - cleanup_ent* ptr = end - block->cleanups; - - for (; ptr < end; ptr++) { - ptr->cleanup(ptr->ud); - } - } - - upb_free(a->block_alloc, block); - block = next; - } -} - -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_CleanupFunc* func) { - cleanup_ent* ent; - uint32_t* cleanups = upb_cleanup_pointer(a->cleanup_metadata); - - 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; - (*cleanups)++; - UPB_UNPOISON_MEMORY_REGION(ent, sizeof(cleanup_ent)); - - ent->cleanup = func; - ent->ud = ud; - - return true; -} - -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. */ - - /* 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; - r1 = r2; - r2 = tmp; - } - - /* r1 takes over r2's freelist and refcount. */ - r1->refcount += r2->refcount; - if (r2->freelist_tail) { - UPB_ASSERT(r2->freelist_tail->next == NULL); - r2->freelist_tail->next = r1->freelist; - r1->freelist = r2->freelist; - } - r2->parent = r1; - return true; -} - /* Miscellaneous utilities ****************************************************/ static void upb_FixLocale(char* p) { diff --git a/third_party/upb/upb/upb.h b/third_party/upb/upb/upb.h index e074911e3bf..7398d09fff5 100644 --- a/third_party/upb/upb/upb.h +++ b/third_party/upb/upb/upb.h @@ -39,34 +39,17 @@ #include #include +// TODO(b/232091617): Remove these and fix everything that breaks as a result. +#include "upb/arena.h" +#include "upb/status.h" + +// Must be last. #include "upb/port_def.inc" #ifdef __cplusplus extern "C" { #endif -/* upb_Status *****************************************************************/ - -#define _kUpb_Status_MaxMessage 127 - -typedef struct { - bool ok; - char msg[_kUpb_Status_MaxMessage]; /* Error message; NULL-terminated. */ -} upb_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_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_StringView ************************************************************/ typedef struct { @@ -96,178 +79,6 @@ UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b) { #define UPB_STRINGVIEW_FORMAT "%.*s" #define UPB_STRINGVIEW_ARGS(view) (int)(view).size, (view).data -/** upb_alloc *****************************************************************/ - -/* A upb_alloc is a possibly-stateful allocator object. - * - * It could either be an arena allocator (which doesn't require individual - * free() calls) or a regular malloc() (which does). The client must therefore - * free memory unless it knows that the allocator is an arena allocator. */ - -struct upb_alloc; -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, - size_t size); - -struct upb_alloc { - upb_alloc_func* func; -}; - -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, - size_t size) { - UPB_ASSERT(alloc); - return alloc->func(alloc, ptr, oldsize, size); -} - -UPB_INLINE void upb_free(upb_alloc* alloc, void* ptr) { - assert(alloc); - alloc->func(alloc, ptr, 0, 0); -} - -/* The global allocator used by upb. Uses the standard malloc()/free(). */ - -extern upb_alloc upb_alloc_global; - -/* Functions that hard-code the global malloc. - * - * 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) { - return upb_malloc(&upb_alloc_global, 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_Arena ******************************************************************/ - -/* 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. - * - * 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_CleanupFunc(void* ud); - -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! - * TODO(haberman): remove once handlers are gone. */ - upb_alloc alloc; - - char *ptr, *end; -} _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_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 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_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); - - h->ptr += size; - -#if UPB_ASAN - { - size_t guard_size = 32; - if (_upb_ArenaHas(a) >= guard_size) { - h->ptr += guard_size; - } else { - h->ptr = h->end; - } - } -#endif - - return ret; -} - -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) { - _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, UPB_MIN(oldsize, size)); - } - - return ret; -} - -UPB_INLINE upb_Arena* upb_Arena_New(void) { - return upb_Arena_Init(NULL, 0, &upb_alloc_global); -} - /* Constants ******************************************************************/ /* A list of types as they are encoded on-the-wire. */ @@ -346,8 +157,8 @@ UPB_INLINE uint64_t _upb_BigEndian_Swap64(uint64_t val) { if (_upb_IsLittleEndian()) { return val; } else { - return ((uint64_t)_upb_BigEndian_Swap32(val) << 32) | - _upb_BigEndian_Swap32(val >> 32); + return ((uint64_t)_upb_BigEndian_Swap32((uint32_t)val) << 32) | + _upb_BigEndian_Swap32((uint32_t)(val >> 32)); } } diff --git a/third_party/upb/upb/upb_internal.h b/third_party/upb/upb/upb_internal.h index 1eb166f7d30..6c1fec3398b 100644 --- a/third_party/upb/upb/upb_internal.h +++ b/third_party/upb/upb/upb_internal.h @@ -28,41 +28,9 @@ #ifndef UPB_INT_H_ #define UPB_INT_H_ -#include "upb/upb.h" +// TODO(b/232091617): Delete this entire header which currently exists only for +// temporary backwards compatibility. -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); +#include "upb/internal/upb.h" #endif /* UPB_INT_H_ */ diff --git a/third_party/upb/upb/util/def_to_proto.c b/third_party/upb/upb/util/def_to_proto.c index 6195336afa5..ae9288c9e0f 100644 --- a/third_party/upb/upb/util/def_to_proto.c +++ b/third_party/upb/upb/util/def_to_proto.c @@ -28,9 +28,11 @@ #include "upb/util/def_to_proto.h" #include +#include #include #include +#include "upb/internal/vsnprintf_compat.h" #include "upb/reflection.h" /* Must be last. */ @@ -88,7 +90,7 @@ static upb_StringView printf_dup(upb_ToProto_Context* ctx, const char* fmt, CHK_OOM(p); va_list args; va_start(args, fmt); - size_t n = vsnprintf(p, max, fmt, args); + size_t n = _upb_vsnprintf(p, max, fmt, args); va_end(args); UPB_ASSERT(n < max); return (upb_StringView){.data = p, .size = n}; @@ -124,6 +126,19 @@ static upb_StringView default_bytes(upb_ToProto_Context* ctx, static upb_StringView default_string(upb_ToProto_Context* ctx, const upb_FieldDef* f) { upb_MessageValue d = upb_FieldDef_Default(f); + upb_CType type = upb_FieldDef_CType(f); + + if (type == kUpb_CType_Float || type == kUpb_CType_Double) { + double val = type == kUpb_CType_Float ? d.float_val : d.double_val; + if (val == INFINITY) { + return strviewdup(ctx, "inf"); + } else if (val == -INFINITY) { + return strviewdup(ctx, "-inf"); + } else if (val != val) { + return strviewdup(ctx, "nan"); + } + } + switch (upb_FieldDef_CType(f)) { case kUpb_CType_Bool: return strviewdup(ctx, d.bool_val ? "true" : "false"); diff --git a/third_party/upb/upb/util/def_to_proto_test.cc b/third_party/upb/upb/util/def_to_proto_test.cc index decc51f88a3..d8156e39891 100644 --- a/third_party/upb/upb/util/def_to_proto_test.cc +++ b/third_party/upb/upb/util/def_to_proto_test.cc @@ -65,22 +65,24 @@ std::unique_ptr ToProto( EXPECT_TRUE(desc != nullptr); std::unique_ptr google_msg( factory->GetPrototype(desc)->New()); + char* buf; size_t size; - const char* buf = - upb_Encode(msg, upb_MessageDef_MiniTable(msgdef), 0, arena.ptr(), &size); + upb_EncodeStatus status = upb_Encode(msg, upb_MessageDef_MiniTable(msgdef), 0, + arena.ptr(), &buf, &size); + EXPECT_EQ(status, kUpb_EncodeStatus_Ok); 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). +// loads a known msgdef into the given defpool). MATCHER_P2(EqualsUpbProto, proto, msgdef_func, negation ? "are not equal" : "are equal") { - upb::SymbolTable symtab; + upb::DefPool defpool; google::protobuf::DescriptorPool pool; google::protobuf::DynamicMessageFactory factory; - upb::MessageDefPtr msgdef(msgdef_func(symtab.ptr())); + upb::MessageDefPtr msgdef(msgdef_func(defpool.ptr())); EXPECT_TRUE(msgdef.ptr() != nullptr); const google::protobuf::Descriptor* desc = AddMessageDescriptor(msgdef, &pool); @@ -115,13 +117,13 @@ void CheckFile(const upb::FileDefPtr file, // serialized descriptor -> upb def -> serialized descriptor TEST(DefToProto, Test) { upb::Arena arena; - upb::SymbolTable symtab; + upb::DefPool defpool; 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::MessageDefPtr msgdef(pkg_Message_getmsgdef(defpool.ptr())); upb::FileDefPtr file = msgdef.file(); CheckFile(file, file_desc); } @@ -129,15 +131,16 @@ TEST(DefToProto, Test) { // Like the previous test, but uses a message layout built at runtime. TEST(DefToProto, TestRuntimeReflection) { upb::Arena arena; - upb::SymbolTable symtab; + upb::DefPool defpool; 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( + defpool.ptr(), + &upb_util_def_to_proto_test_proto_upbdefinit, true); + upb::FileDefPtr file = defpool.FindFileByName( upb_util_def_to_proto_test_proto_upbdefinit.filename); CheckFile(file, file_desc); } diff --git a/third_party/upb/upb/util/required_fields.c b/third_party/upb/upb/util/required_fields.c index 0e97949e099..90f40b65166 100644 --- a/third_party/upb/upb/util/required_fields.c +++ b/third_party/upb/upb/util/required_fields.c @@ -32,6 +32,7 @@ #include #include +#include "upb/internal/vsnprintf_compat.h" #include "upb/reflection.h" // Must be last. @@ -55,7 +56,7 @@ static void upb_FieldPath_Printf(upb_PrintfAppender* a, const char* fmt, ...) { va_list args; va_start(args, fmt); - n = vsnprintf(a->ptr, have, fmt, args); + n = _upb_vsnprintf(a->ptr, have, fmt, args); va_end(args); if (UPB_LIKELY(have > n)) { diff --git a/third_party/upb/upb/util/required_fields_test.cc b/third_party/upb/upb/util/required_fields_test.cc index 860363f4a4a..85504101e65 100644 --- a/third_party/upb/upb/util/required_fields_test.cc +++ b/third_party/upb/upb/util/required_fields_test.cc @@ -60,25 +60,25 @@ std::vector PathsToText(upb_FieldPathEntry* entry) { void CheckRequired(absl::string_view json, const std::vector& missing) { upb::Arena arena; - upb::SymbolTable symtab; + upb::DefPool defpool; upb_util_test_TestRequiredFields* test_msg = upb_util_test_TestRequiredFields_new(arena.ptr()); upb::MessageDefPtr m( - upb_util_test_TestRequiredFields_getmsgdef(symtab.ptr())); + upb_util_test_TestRequiredFields_getmsgdef(defpool.ptr())); upb::Status status; EXPECT_TRUE(upb_JsonDecode(json.data(), json.size(), test_msg, m.ptr(), - symtab.ptr(), 0, arena.ptr(), status.ptr())) + defpool.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)); + test_msg, m.ptr(), defpool.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)); + upb_util_HasUnsetRequired(test_msg, m.ptr(), defpool.ptr(), NULL)); } // message HasRequiredField { diff --git a/third_party/upb/upbc/BUILD b/third_party/upb/upbc/BUILD index 0b98f2902e7..d32ffa45a0a 100644 --- a/third_party/upb/upbc/BUILD +++ b/third_party/upb/upbc/BUILD @@ -27,9 +27,45 @@ load( "//bazel:build_defs.bzl", "UPB_DEFAULT_CPPOPTS", ) +load( + "//bazel:upb_proto_library.bzl", + "upb_proto_library", + "upb_proto_reflection_library", +) licenses(["notice"]) +proto_library( + name = "code_generator_request", + srcs = ["code_generator_request.proto"], + visibility = ["//:friends"], + deps = ["@com_google_protobuf//:compiler_plugin_proto"], +) + +upb_proto_library( + name = "code_generator_request_upb_proto", + visibility = ["//:friends"], + deps = [":code_generator_request"], +) + +upb_proto_reflection_library( + name = "code_generator_request_upb_proto_reflection", + visibility = ["//:friends"], + deps = [":code_generator_request"], +) + +upb_proto_library( + name = "plugin_upb_proto", + visibility = ["//:friends"], + deps = ["@com_google_protobuf//:compiler_plugin_proto"], +) + +upb_proto_reflection_library( + name = "plugin_upb_proto_reflection", + visibility = ["//:friends"], + deps = ["@com_google_protobuf//:compiler_plugin_proto"], +) + cc_library( name = "common", srcs = ["common.cc"], @@ -76,3 +112,29 @@ cc_binary( "@com_google_protobuf//:protoc_lib", ], ) + +cc_binary( + name = "protoc-gen-upbdev", + srcs = [ + "code_generator_request.c", + "code_generator_request.h", + "protoc-gen-upbdev.cc", + "subprocess.cc", + "subprocess.h", + ], + copts = UPB_DEFAULT_CPPOPTS, + visibility = ["//visibility:public"], + deps = [ + ":code_generator_request_upb_proto", + ":code_generator_request_upb_proto_reflection", + ":plugin_upb_proto", + ":plugin_upb_proto_reflection", + "//:json", + "//:mini_descriptor", + "//:mini_table", + "//:port", + "//:reflection", + "//:upb", + "@com_google_absl//absl/strings", + ], +) diff --git a/third_party/upb/upbc/code_generator_request.c b/third_party/upb/upbc/code_generator_request.c new file mode 100644 index 00000000000..2591690f15e --- /dev/null +++ b/third_party/upb/upbc/code_generator_request.c @@ -0,0 +1,209 @@ +/* + * 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. + */ + +#include "upbc/code_generator_request.h" + +#include +#include +#include + +#include "google/protobuf/compiler/plugin.upb.h" +#include "upb/mini_descriptor.h" +#include "upb/mini_table.h" + +// Must be last. +#include "upb/port_def.inc" + +/******************************************************************************/ + +// Kitchen sink storage for all of our state as we build the mini descriptors. + +typedef struct { + upb_Arena* arena; + upb_Status* status; + upb_DefPool* symtab; + + upbc_CodeGeneratorRequest* out; + + jmp_buf jmp; +} upbc_State; + +static void upbc_State_Fini(upbc_State* s) { + if (s->symtab) upb_DefPool_Free(s->symtab); +} + +static void upbc_Error(upbc_State* s, const char* fn, const char* msg) { + upb_Status_SetErrorFormat(s->status, "%s(): %s", fn, msg); + upbc_State_Fini(s); + UPB_LONGJMP(s->jmp, -1); +} + +static void upbc_State_Init(upbc_State* s) { + s->symtab = upb_DefPool_New(); + if (!s->symtab) upbc_Error(s, __func__, "could not allocate def pool"); + + s->out = upbc_CodeGeneratorRequest_new(s->arena); + if (!s->out) upbc_Error(s, __func__, "could not allocate request"); +} + +static void upbc_State_Emit(upbc_State* s, const char* name, + upb_StringView encoding) { + const upb_StringView key = upb_StringView_FromString(name); + bool ok = upbc_CodeGeneratorRequest_mini_descriptors_set(s->out, key, + encoding, s->arena); + if (!ok) upbc_Error(s, __func__, "could not set mini descriptor in map"); +} + +/******************************************************************************/ + +// Forward declaration. +static void upbc_Scrape_Message(upbc_State*, const upb_MessageDef*); + +static void upbc_Scrape_Enum(upbc_State* s, const upb_EnumDef* enum_def) { + const char* name = upb_EnumDef_FullName(enum_def); + const upb_StringView encoding = + upb_MiniDescriptor_EncodeEnum(enum_def, s->arena); + upbc_State_Emit(s, name, encoding); +} + +static void upbc_Scrape_Extension(upbc_State* s, + const upb_FieldDef* field_def) { + const char* name = upb_FieldDef_FullName(field_def); + const upb_StringView encoding = + upb_MiniDescriptor_EncodeExtension(field_def, s->arena); + upbc_State_Emit(s, name, encoding); +} + +static void upbc_Scrape_FileEnums(upbc_State* s, const upb_FileDef* file_def) { + const size_t len = upb_FileDef_TopLevelEnumCount(file_def); + for (size_t i = 0; i < len; i++) { + const upb_EnumDef* enum_def = upb_FileDef_TopLevelEnum(file_def, i); + upbc_Scrape_Enum(s, enum_def); + } +} + +static void upbc_Scrape_FileExtensions(upbc_State* s, + const upb_FileDef* file_def) { + const size_t len = upb_FileDef_TopLevelExtensionCount(file_def); + for (size_t i = 0; i < len; i++) { + const upb_FieldDef* field_def = upb_FileDef_TopLevelExtension(file_def, i); + upbc_Scrape_Extension(s, field_def); + } +} + +static void upbc_Scrape_FileMessages(upbc_State* s, + const upb_FileDef* file_def) { + const size_t len = upb_FileDef_TopLevelMessageCount(file_def); + for (size_t i = 0; i < len; i++) { + const upb_MessageDef* message_def = + upb_FileDef_TopLevelMessage(file_def, i); + upbc_Scrape_Message(s, message_def); + } +} + +static void upbc_Scrape_File(upbc_State* s, const upb_FileDef* file_def) { + upbc_Scrape_FileEnums(s, file_def); + upbc_Scrape_FileExtensions(s, file_def); + upbc_Scrape_FileMessages(s, file_def); +} + +static void upbc_Scrape_Files(upbc_State* s) { + const google_protobuf_compiler_CodeGeneratorRequest* request = + upbc_CodeGeneratorRequest_request(s->out); + + size_t len = 0; + const google_protobuf_FileDescriptorProto* const* file_types = + google_protobuf_compiler_CodeGeneratorRequest_proto_file(request, &len); + + for (size_t i = 0; i < len; i++) { + const upb_FileDef* file_def = + upb_DefPool_AddFile(s->symtab, file_types[i], s->status); + if (!file_def) upbc_Error(s, __func__, "could not add file to def pool"); + + upbc_Scrape_File(s, file_def); + } +} + +static void upbc_Scrape_NestedEnums(upbc_State* s, + const upb_MessageDef* message_def) { + const size_t len = upb_MessageDef_NestedEnumCount(message_def); + for (size_t i = 0; i < len; i++) { + const upb_EnumDef* enum_def = upb_MessageDef_NestedEnum(message_def, i); + upbc_Scrape_Enum(s, enum_def); + } +} + +static void upbc_Scrape_NestedExtensions(upbc_State* s, + const upb_MessageDef* message_def) { + const size_t len = upb_MessageDef_NestedExtensionCount(message_def); + for (size_t i = 0; i < len; i++) { + const upb_FieldDef* field_def = + upb_MessageDef_NestedExtension(message_def, i); + upbc_Scrape_Extension(s, field_def); + } +} + +static void upbc_Scrape_NestedMessages(upbc_State* s, + const upb_MessageDef* message_def) { + const size_t len = upb_MessageDef_NestedMessageCount(message_def); + for (size_t i = 0; i < len; i++) { + const upb_MessageDef* nested_def = + upb_MessageDef_NestedMessage(message_def, i); + upbc_Scrape_Message(s, nested_def); + } +} + +static void upbc_Scrape_Message(upbc_State* s, + const upb_MessageDef* message_def) { + const char* name = upb_MessageDef_FullName(message_def); + const upb_StringView encoding = + upb_MiniDescriptor_EncodeMessage(message_def, s->arena); + upbc_State_Emit(s, name, encoding); + + upbc_Scrape_NestedEnums(s, message_def); + upbc_Scrape_NestedExtensions(s, message_def); + upbc_Scrape_NestedMessages(s, message_def); +} + +upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( + google_protobuf_compiler_CodeGeneratorRequest* request, upb_Arena* arena, + upb_Status* status) { + upbc_State s = { + .arena = arena, + .status = status, + .symtab = NULL, + .out = NULL, + }; + + if (UPB_SETJMP(s.jmp)) return NULL; + upbc_State_Init(&s); + + upbc_CodeGeneratorRequest_set_request(s.out, request); + upbc_Scrape_Files(&s); + upbc_State_Fini(&s); + return s.out; +} diff --git a/third_party/upb/upbc/code_generator_request.h b/third_party/upb/upbc/code_generator_request.h new file mode 100644 index 00000000000..747d98d84d6 --- /dev/null +++ b/third_party/upb/upbc/code_generator_request.h @@ -0,0 +1,52 @@ +/* + * 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 UPBC_CODE_GENERATOR_REQUEST_H_ +#define UPBC_CODE_GENERATOR_REQUEST_H_ + +#include "upb/def.h" +#include "upb/upb.h" +#include "upbc/code_generator_request.upb.h" + +// Must be last. +#include "upb/port_def.inc" + +#ifdef __cplusplus +extern "C" { +#endif + +upbc_CodeGeneratorRequest* upbc_MakeCodeGeneratorRequest( + struct google_protobuf_compiler_CodeGeneratorRequest* request, upb_Arena* a, + upb_Status* s); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#include "upb/port_undef.inc" + +#endif /* UPBC_CODE_GENERATOR_REQUEST_H_ */ diff --git a/third_party/upb/upbc/code_generator_request.proto b/third_party/upb/upbc/code_generator_request.proto new file mode 100644 index 00000000000..5491b136937 --- /dev/null +++ b/third_party/upb/upbc/code_generator_request.proto @@ -0,0 +1,13 @@ +syntax = "proto2"; + +package upbc; + +import "google/protobuf/compiler/plugin.proto"; + +message CodeGeneratorRequest { + // The pb sent by protoc to its plugins. + optional google.protobuf.compiler.CodeGeneratorRequest request = 1; + + // Mini descriptors for the above pb, keyed by the fully qualified names. + map mini_descriptors = 2; +} diff --git a/third_party/upb/upbc/protoc-gen-upb.cc b/third_party/upb/upbc/protoc-gen-upb.cc index bd6196c711c..c2968dcad7d 100644 --- a/third_party/upb/upbc/protoc-gen-upb.cc +++ b/third_party/upb/upbc/protoc-gen-upb.cc @@ -119,12 +119,12 @@ std::vector SortedEnums( return enums; } -std::vector SortedUniqueEnumNumbers( +std::vector SortedUniqueEnumNumbers( const protobuf::EnumDescriptor* e) { - std::vector values; + std::vector values; values.reserve(e->value_count()); for (int i = 0; i < e->value_count(); i++) { - values.push_back(e->value(i)->number()); + values.push_back(static_cast(e->value(i)->number())); } std::sort(values.begin(), values.end()); auto last = std::unique(values.begin(), values.end()); @@ -350,6 +350,7 @@ class FilePlatformLayout { // 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; + upb_MiniTable_Enum* GetEnumTable(const protobuf::EnumDescriptor* d) const; const upb_MiniTable_Extension* GetExtension( const protobuf::FieldDescriptor* fd) const; @@ -362,6 +363,7 @@ class FilePlatformLayout { void BuildExtensions(const protobuf::FileDescriptor* fd); upb_MiniTable* MakeMiniTable(const protobuf::Descriptor* m); upb_MiniTable* MakeRegularMiniTable(const protobuf::Descriptor* m); + upb_MiniTable_Enum* MakeMiniTableEnum(const protobuf::EnumDescriptor* d); uint64_t GetMessageModifiers(const protobuf::Descriptor* m); uint64_t GetFieldModifiers(const protobuf::FieldDescriptor* f); void ResolveIntraFileReferences(); @@ -394,10 +396,13 @@ class FilePlatformLayout { private: using TableMap = absl::flat_hash_map; + using EnumMap = + absl::flat_hash_map; using ExtensionMap = absl::flat_hash_map; upb::Arena arena_; TableMap table_map_; + EnumMap enum_map_; ExtensionMap extension_map_; upb_MiniTablePlatform platform_; }; @@ -409,6 +414,13 @@ upb_MiniTable* FilePlatformLayout::GetMiniTable( return it->second; } +upb_MiniTable_Enum* FilePlatformLayout::GetEnumTable( + const protobuf::EnumDescriptor* d) const { + auto it = enum_map_.find(d); + assert(it != enum_map_.end()); + return it->second; +} + const upb_MiniTable_Extension* FilePlatformLayout::GetExtension( const protobuf::FieldDescriptor* fd) const { auto it = extension_map_.find(fd); @@ -503,6 +515,9 @@ void FilePlatformLayout::BuildMiniTables(const protobuf::FileDescriptor* fd) { for (const auto& m : SortedMessages(fd)) { table_map_[m] = MakeMiniTable(m); } + for (const auto& e : SortedEnums(fd)) { + enum_map_[e] = MakeMiniTableEnum(e); + } ResolveIntraFileReferences(); SetSubTableStrings(); } @@ -564,7 +579,7 @@ upb_MiniTable* FilePlatformLayout::MakeRegularMiniTable( e.PutOneofField(f->number()); } } - const std::string& str = e.data(); + absl::string_view str = e.data(); upb::Status status; upb_MiniTable* ret = upb_MiniTable_Build(str.data(), str.size(), platform_, arena_.ptr(), status.ptr()); @@ -575,6 +590,28 @@ upb_MiniTable* FilePlatformLayout::MakeRegularMiniTable( return ret; } +upb_MiniTable_Enum* FilePlatformLayout::MakeMiniTableEnum( + const protobuf::EnumDescriptor* d) { + upb::Arena arena; + upb::MtDataEncoder e; + + e.StartEnum(); + for (uint32_t i : SortedUniqueEnumNumbers(d)) { + e.PutEnumValue(i); + } + e.EndEnum(); + + absl::string_view str = e.data(); + upb::Status status; + upb_MiniTable_Enum* ret = upb_MiniTable_BuildEnum(str.data(), str.size(), + 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; @@ -632,6 +669,11 @@ class FileLayout { return layout64_.GetMiniTable(m); } + const upb_MiniTable_Enum* GetEnumTable( + const protobuf::EnumDescriptor* d) const { + return layout64_.GetEnumTable(d); + } + std::string GetFieldOffset(const protobuf::FieldDescriptor* f) const { const upb_MiniTable_Field* f_32 = upb_MiniTable_FindFieldByNumber( GetMiniTable32(f->containing_type()), f->number()); @@ -734,7 +776,7 @@ void GenerateExtensionInHeader(const protobuf::FieldDescriptor* ext, 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_Message_GetOrCreateExtension(msg, &$4, arena); UPB_ASSERT(msg_ext); *UPB_PTR_AT(&msg_ext->data, 0, $0) = ext; } @@ -759,6 +801,8 @@ void GenerateExtensionInHeader(const protobuf::FieldDescriptor* ext, void GenerateMessageFunctionsInHeader(const protobuf::Descriptor* message, Output& output) { + // TODO(b/235839510): The generated code here does not check the return values + // from upb_Encode(). How can we even fix this without breaking other things? output( R"cc( UPB_INLINE $0* $0_new(upb_Arena* arena) { @@ -784,11 +828,15 @@ void GenerateMessageFunctionsInHeader(const protobuf::Descriptor* message, return ret; } UPB_INLINE char* $0_serialize(const $0* msg, upb_Arena* arena, size_t* len) { - return upb_Encode(msg, &$1, 0, arena, len); + char* ptr; + (void)upb_Encode(msg, &$1, 0, arena, &ptr, len); + return ptr; } 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); + char* ptr; + (void)upb_Encode(msg, &$1, options, arena, &ptr, len); + return ptr; } )cc", MessageName(message), MessageInit(message)); @@ -1742,7 +1790,35 @@ void WriteMessage(const protobuf::Descriptor* message, const FileLayout& layout, output("};\n\n"); } -int WriteEnums(const protobuf::FileDescriptor* file, Output& output) { +void WriteEnum(const upb_MiniTable_Enum* mt, const protobuf::EnumDescriptor* e, + Output& output) { + std::string values_init = "NULL"; + + if (mt->value_count) { + values_init = EnumInit(e) + "_values"; + output("static const int32_t $0[$1] = {\n", values_init, mt->value_count); + for (int i = 0; i < mt->value_count; i++) { + output(" $0,\n", mt->values[i]); + } + output("};\n\n"); + } + + output( + R"cc( + const upb_MiniTable_Enum $0 = { + $1, + $2, + $3, + }; + )cc", + EnumInit(e), values_init, absl::StrCat("0x", absl::Hex(mt->mask), "ULL"), + mt->value_count); + output("\n"); +} + +int WriteEnums(const FileLayout& layout, Output& output) { + const protobuf::FileDescriptor* file = layout.descriptor(); + if (file->syntax() != protobuf::FileDescriptor::SYNTAX_PROTO2) { return 0; } @@ -1750,34 +1826,8 @@ int WriteEnums(const protobuf::FileDescriptor* file, Output& output) { std::vector this_file_enums = SortedEnums(file); - std::string values_init = "NULL"; - for (const auto* e : this_file_enums) { - uint64_t mask = 0; - std::vector values; - for (auto number : SortedUniqueEnumNumbers(e)) { - if (static_cast(number) < 64) { - mask |= 1ULL << number; - } else { - values.push_back(number); - } - } - - 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"); + WriteEnum(layout.GetEnumTable(e), e, output); } if (!this_file_enums.empty()) { @@ -1884,9 +1934,9 @@ void WriteSource(const FileLayout& layout, Output& output, "#include \"upb/port_def.inc\"\n" "\n"); - int msg_count = WriteMessages(file, output, fasttable_enabled); + int msg_count = WriteMessages(layout, output, fasttable_enabled); int ext_count = WriteExtensions(layout, output); - int enum_count = WriteEnums(file, output); + int enum_count = WriteEnums(layout, output); output("const upb_MiniTable_File $0 = {\n", FileLayoutName(file)); output(" $0,\n", msg_count ? kMessagesInit : "NULL"); diff --git a/third_party/upb/upbc/protoc-gen-upbdev.cc b/third_party/upb/upbc/protoc-gen-upbdev.cc new file mode 100644 index 00000000000..e711ec75b53 --- /dev/null +++ b/third_party/upb/upbc/protoc-gen-upbdev.cc @@ -0,0 +1,144 @@ +// 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. + +#include + +#include +#include + +#include "google/protobuf/compiler/plugin.upb.h" +#include "google/protobuf/compiler/plugin.upbdefs.h" +#include "upb/json_decode.h" +#include "upb/json_encode.h" +#include "upb/mini_descriptor.h" +#include "upb/upb.h" +#include "upbc/code_generator_request.h" +#include "upbc/code_generator_request.upb.h" +#include "upbc/code_generator_request.upbdefs.h" +#include "upbc/subprocess.h" + +static constexpr char kDefaultPlugin[] = "protoc_dart_plugin"; + +static std::string JsonEncode(const upbc_CodeGeneratorRequest* request, + upb_Arena* a) { + upb_DefPool* s = upb_DefPool_New(); + const upb_MessageDef* m = upbc_CodeGeneratorRequest_getmsgdef(s); + + upb_Status status; + upb_Status_Clear(&status); + + const size_t json_size = upb_JsonEncode(request, m, s, 0, NULL, 0, &status); + assert(upb_Status_IsOk(&status)); + + char* json_buf = (char*)upb_Arena_Malloc(a, json_size + 1); + + (void)upb_JsonEncode(request, m, s, 0, json_buf, json_size + 1, &status); + assert(upb_Status_IsOk(&status)); + + upb_DefPool_Free(s); + + return std::string(json_buf, json_size); +} + +static google_protobuf_compiler_CodeGeneratorResponse* JsonDecode( + const std::string& json, upb_Arena* a) { + google_protobuf_compiler_CodeGeneratorResponse* response = + google_protobuf_compiler_CodeGeneratorResponse_new(a); + + upb_DefPool* s = upb_DefPool_New(); + const upb_MessageDef* m = google_protobuf_compiler_CodeGeneratorResponse_getmsgdef(s); + + upb_Status status; + upb_Status_Clear(&status); + + (void)upb_JsonDecode(json.c_str(), json.size(), response, m, s, 0, a, + &status); + assert(upb_Status_IsOk(&status)); + + upb_DefPool_Free(s); + + return response; +} + +static std::string Serialize( + const google_protobuf_compiler_CodeGeneratorResponse* response, upb_Arena* a) { + size_t len = 0; + const char* buf = + google_protobuf_compiler_CodeGeneratorResponse_serialize(response, a, &len); + return std::string(buf, len); +} + +int main() { + upb_Arena* a = upb_Arena_New(); + + // Read (binary) stdin into a string. + const std::string input = {std::istreambuf_iterator(std::cin), + std::istreambuf_iterator()}; + + // Parse the request. + auto inner_request = google_protobuf_compiler_CodeGeneratorRequest_parse( + input.c_str(), input.size(), a); + + // Check the request for a plugin name. + std::string plugin = kDefaultPlugin; + if (google_protobuf_compiler_CodeGeneratorRequest_has_parameter(inner_request)) { + auto param = google_protobuf_compiler_CodeGeneratorRequest_parameter(inner_request); + plugin = std::string(param.data, param.size); + } + + // Wrap the request inside a upbc_CodeGeneratorRequest. + upb_Status status; + upb_Status_Clear(&status); + auto outer_request = upbc_MakeCodeGeneratorRequest(inner_request, a, &status); + if (!upb_Status_IsOk(&status)) { + std::cerr << status.msg << std::endl; + return -1; + } + + const std::string json_request = JsonEncode(outer_request, a); + + // Launch the subprocess. + upbc::Subprocess subprocess; + subprocess.Start(plugin, upbc::Subprocess::SEARCH_PATH); + + // Exchange JSON strings with the subprocess. + std::string json_response, error; + const bool ok = subprocess.Communicate(json_request, &json_response, &error); + if (!ok) { + // Dump the JSON request to stderr if we can't launch the next plugin. + std::cerr << json_request << std::endl; + return -1; + } + + // Decode and serialize the JSON response. + const auto response = JsonDecode(json_response, a); + const std::string output = Serialize(response, a); + + // Question: Is this sufficient for sending reliably to stdout? + std::cout << output; + + upb_Arena_Free(a); + return 0; +} diff --git a/third_party/upb/upbc/subprocess.cc b/third_party/upb/upbc/subprocess.cc new file mode 100644 index 00000000000..e46abc86fca --- /dev/null +++ b/third_party/upb/upbc/subprocess.cc @@ -0,0 +1,462 @@ +/* + * 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. + */ + +// Shamelessly copied from the protobuf compiler's subprocess.cc +// except this version passes strings instead of Messages. + +#include "upbc/subprocess.h" + +#include +#include +#include + +#ifndef _WIN32 +#include +#include +#include +#include +#endif + +#include "absl/strings/substitute.h" +#include "upb/upb.h" + +/* Must be last. */ +#include "upb/port_def.inc" + +namespace upbc { + +namespace { +char* portable_strdup(const char* s) { + char* ns = (char*)malloc(strlen(s) + 1); + if (ns != nullptr) { + strcpy(ns, s); + } + return ns; +} +} // namespace + +#ifdef _WIN32 + +static void CloseHandleOrDie(HANDLE handle) { + if (!CloseHandle(handle)) { + GOOGLE_LOG(FATAL) << "CloseHandle: " + << Subprocess::Win32ErrorMessage(GetLastError()); + } +} + +Subprocess::Subprocess() + : process_start_error_(ERROR_SUCCESS), + child_handle_(nullptr), + child_stdin_(nullptr), + child_stdout_(nullptr) {} + +Subprocess::~Subprocess() { + if (child_stdin_ != nullptr) { + CloseHandleOrDie(child_stdin_); + } + if (child_stdout_ != nullptr) { + CloseHandleOrDie(child_stdout_); + } +} + +void Subprocess::Start(const std::string& program, SearchMode search_mode) { + // Create the pipes. + HANDLE stdin_pipe_read; + HANDLE stdin_pipe_write; + HANDLE stdout_pipe_read; + HANDLE stdout_pipe_write; + + if (!CreatePipe(&stdin_pipe_read, &stdin_pipe_write, nullptr, 0)) { + GOOGLE_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); + } + if (!CreatePipe(&stdout_pipe_read, &stdout_pipe_write, nullptr, 0)) { + GOOGLE_LOG(FATAL) << "CreatePipe: " << Win32ErrorMessage(GetLastError()); + } + + // Make child side of the pipes inheritable. + if (!SetHandleInformation(stdin_pipe_read, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT)) { + GOOGLE_LOG(FATAL) << "SetHandleInformation: " + << Win32ErrorMessage(GetLastError()); + } + if (!SetHandleInformation(stdout_pipe_write, HANDLE_FLAG_INHERIT, + HANDLE_FLAG_INHERIT)) { + GOOGLE_LOG(FATAL) << "SetHandleInformation: " + << Win32ErrorMessage(GetLastError()); + } + + // Setup STARTUPINFO to redirect handles. + STARTUPINFOA startup_info; + ZeroMemory(&startup_info, sizeof(startup_info)); + startup_info.cb = sizeof(startup_info); + startup_info.dwFlags = STARTF_USESTDHANDLES; + startup_info.hStdInput = stdin_pipe_read; + startup_info.hStdOutput = stdout_pipe_write; + startup_info.hStdError = GetStdHandle(STD_ERROR_HANDLE); + + if (startup_info.hStdError == INVALID_HANDLE_VALUE) { + GOOGLE_LOG(FATAL) << "GetStdHandle: " << Win32ErrorMessage(GetLastError()); + } + + // Invoking cmd.exe allows for '.bat' files from the path as well as '.exe'. + // Using a malloc'ed string because CreateProcess() can mutate its second + // parameter. + char* command_line = + portable_strdup(("cmd.exe /c \"" + program + "\"").c_str()); + + // Create the process. + PROCESS_INFORMATION process_info; + + if (CreateProcessA((search_mode == SEARCH_PATH) ? nullptr : program.c_str(), + (search_mode == SEARCH_PATH) ? command_line : nullptr, + nullptr, // process security attributes + nullptr, // thread security attributes + TRUE, // inherit handles? + 0, // obscure creation flags + nullptr, // environment (inherit from parent) + nullptr, // current directory (inherit from parent) + &startup_info, &process_info)) { + child_handle_ = process_info.hProcess; + CloseHandleOrDie(process_info.hThread); + child_stdin_ = stdin_pipe_write; + child_stdout_ = stdout_pipe_read; + } else { + process_start_error_ = GetLastError(); + CloseHandleOrDie(stdin_pipe_write); + CloseHandleOrDie(stdout_pipe_read); + } + + CloseHandleOrDie(stdin_pipe_read); + CloseHandleOrDie(stdout_pipe_write); + free(command_line); +} + +bool Subprocess::Communicate(const std::string& input_data, + std::string* output_data, std::string* error) { + if (process_start_error_ != ERROR_SUCCESS) { + *error = Win32ErrorMessage(process_start_error_); + return false; + } + + GOOGLE_CHECK(child_handle_ != nullptr) << "Must call Start() first."; + + int input_pos = 0; + + while (child_stdout_ != nullptr) { + HANDLE handles[2]; + int handle_count = 0; + + if (child_stdin_ != nullptr) { + handles[handle_count++] = child_stdin_; + } + if (child_stdout_ != nullptr) { + handles[handle_count++] = child_stdout_; + } + + DWORD wait_result = + WaitForMultipleObjects(handle_count, handles, FALSE, INFINITE); + + HANDLE signaled_handle = nullptr; + if (wait_result >= WAIT_OBJECT_0 && + wait_result < WAIT_OBJECT_0 + handle_count) { + signaled_handle = handles[wait_result - WAIT_OBJECT_0]; + } else if (wait_result == WAIT_FAILED) { + GOOGLE_LOG(FATAL) << "WaitForMultipleObjects: " + << Win32ErrorMessage(GetLastError()); + } else { + GOOGLE_LOG(FATAL) << "WaitForMultipleObjects: Unexpected return code: " + << wait_result; + } + + if (signaled_handle == child_stdin_) { + DWORD n; + if (!WriteFile(child_stdin_, input_data.data() + input_pos, + input_data.size() - input_pos, &n, nullptr)) { + // Child closed pipe. Presumably it will report an error later. + // Pretend we're done for now. + input_pos = input_data.size(); + } else { + input_pos += n; + } + + if (input_pos == input_data.size()) { + // We're done writing. Close. + CloseHandleOrDie(child_stdin_); + child_stdin_ = nullptr; + } + } else if (signaled_handle == child_stdout_) { + char buffer[4096]; + DWORD n; + + if (!ReadFile(child_stdout_, buffer, sizeof(buffer), &n, nullptr)) { + // We're done reading. Close. + CloseHandleOrDie(child_stdout_); + child_stdout_ = nullptr; + } else { + output_data->append(buffer, n); + } + } + } + + if (child_stdin_ != nullptr) { + // Child did not finish reading input before it closed the output. + // Presumably it exited with an error. + CloseHandleOrDie(child_stdin_); + child_stdin_ = nullptr; + } + + DWORD wait_result = WaitForSingleObject(child_handle_, INFINITE); + + if (wait_result == WAIT_FAILED) { + GOOGLE_LOG(FATAL) << "WaitForSingleObject: " + << Win32ErrorMessage(GetLastError()); + } else if (wait_result != WAIT_OBJECT_0) { + GOOGLE_LOG(FATAL) << "WaitForSingleObject: Unexpected return code: " + << wait_result; + } + + DWORD exit_code; + if (!GetExitCodeProcess(child_handle_, &exit_code)) { + GOOGLE_LOG(FATAL) << "GetExitCodeProcess: " + << Win32ErrorMessage(GetLastError()); + } + + CloseHandleOrDie(child_handle_); + child_handle_ = nullptr; + + if (exit_code != 0) { + *error = absl::Substitute("Plugin failed with status code $0.", exit_code); + return false; + } + + return true; +} + +std::string Subprocess::Win32ErrorMessage(DWORD error_code) { + char* message; + + // WTF? + FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, error_code, + MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), + (LPSTR)&message, // NOT A BUG! + 0, nullptr); + + std::string result = message; + LocalFree(message); + return result; +} + +// =================================================================== + +#else // _WIN32 + +Subprocess::Subprocess() + : child_pid_(-1), child_stdin_(-1), child_stdout_(-1) {} + +Subprocess::~Subprocess() { + if (child_stdin_ != -1) { + close(child_stdin_); + } + if (child_stdout_ != -1) { + close(child_stdout_); + } +} + +void Subprocess::Start(const std::string& program, SearchMode search_mode) { + // Note that we assume that there are no other threads, thus we don't have to + // do crazy stuff like using socket pairs or avoiding libc locks. + + // [0] is read end, [1] is write end. + int stdin_pipe[2]; + int stdout_pipe[2]; + + int p0 = pipe(stdin_pipe); + int p1 = pipe(stdout_pipe); + UPB_ASSERT(p0 != -1); + UPB_ASSERT(p1 != -1); + + char* argv[2] = {portable_strdup(program.c_str()), nullptr}; + + child_pid_ = fork(); + if (child_pid_ == -1) { + std::cerr << "fork: " << strerror(errno); + } else if (child_pid_ == 0) { + // We are the child. + dup2(stdin_pipe[0], STDIN_FILENO); + dup2(stdout_pipe[1], STDOUT_FILENO); + + close(stdin_pipe[0]); + close(stdin_pipe[1]); + close(stdout_pipe[0]); + close(stdout_pipe[1]); + + switch (search_mode) { + case SEARCH_PATH: + execvp(argv[0], argv); + break; + case EXACT_NAME: + execv(argv[0], argv); + break; + } + + // Write directly to STDERR_FILENO to avoid stdio code paths that may do + // stuff that is unsafe here. + int ignored; + ignored = write(STDERR_FILENO, argv[0], strlen(argv[0])); + const char* message = + ": program not found or is not executable\n" + "Please specify a program using absolute path or make sure " + "the program is available in your PATH system variable\n"; + ignored = write(STDERR_FILENO, message, strlen(message)); + (void)ignored; + + // Must use _exit() rather than exit() to avoid flushing output buffers + // that will also be flushed by the parent. + _exit(1); + } else { + free(argv[0]); + + close(stdin_pipe[0]); + close(stdout_pipe[1]); + + child_stdin_ = stdin_pipe[1]; + child_stdout_ = stdout_pipe[0]; + } +} + +bool Subprocess::Communicate(const std::string& input_data, + std::string* output_data, std::string* error) { + if (child_stdin_ == -1) { + std::cerr << "Must call Start() first." << std::endl; + UPB_ASSERT(child_stdin_ != -1); + } + + // The "sighandler_t" typedef is GNU-specific, so define our own. + typedef void SignalHandler(int); + + // Make sure SIGPIPE is disabled so that if the child dies it doesn't kill us. + SignalHandler* old_pipe_handler = signal(SIGPIPE, SIG_IGN); + + int input_pos = 0; + int max_fd = std::max(child_stdin_, child_stdout_); + + while (child_stdout_ != -1) { + fd_set read_fds; + fd_set write_fds; + FD_ZERO(&read_fds); + FD_ZERO(&write_fds); + if (child_stdout_ != -1) { + FD_SET(child_stdout_, &read_fds); + } + if (child_stdin_ != -1) { + FD_SET(child_stdin_, &write_fds); + } + + if (select(max_fd + 1, &read_fds, &write_fds, nullptr, nullptr) < 0) { + if (errno == EINTR) { + // Interrupted by signal. Try again. + continue; + } else { + std::cerr << "select: " << strerror(errno) << std::endl; + UPB_ASSERT(0); + } + } + + if (child_stdin_ != -1 && FD_ISSET(child_stdin_, &write_fds)) { + int n = write(child_stdin_, input_data.data() + input_pos, + input_data.size() - input_pos); + if (n < 0) { + // Child closed pipe. Presumably it will report an error later. + // Pretend we're done for now. + input_pos = input_data.size(); + } else { + input_pos += n; + } + + if (input_pos == (int)input_data.size()) { + // We're done writing. Close. + close(child_stdin_); + child_stdin_ = -1; + } + } + + if (child_stdout_ != -1 && FD_ISSET(child_stdout_, &read_fds)) { + char buffer[4096]; + int n = read(child_stdout_, buffer, sizeof(buffer)); + + if (n > 0) { + output_data->append(buffer, (size_t)n); + } else { + // We're done reading. Close. + close(child_stdout_); + child_stdout_ = -1; + } + } + } + + if (child_stdin_ != -1) { + // Child did not finish reading input before it closed the output. + // Presumably it exited with an error. + close(child_stdin_); + child_stdin_ = -1; + } + + int status; + while (waitpid(child_pid_, &status, 0) == -1) { + if (errno != EINTR) { + std::cerr << "waitpid: " << strerror(errno) << std::endl; + UPB_ASSERT(0); + } + } + + // Restore SIGPIPE handling. + signal(SIGPIPE, old_pipe_handler); + + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) != 0) { + int error_code = WEXITSTATUS(status); + *error = + absl::Substitute("Plugin failed with status code $0.", error_code); + return false; + } + } else if (WIFSIGNALED(status)) { + int signal = WTERMSIG(status); + *error = absl::Substitute("Plugin killed by signal $0.", signal); + return false; + } else { + *error = "Neither WEXITSTATUS nor WTERMSIG is true?"; + return false; + } + + return true; +} + +#endif // !_WIN32 + +} // namespace upbc diff --git a/third_party/upb/upbc/subprocess.h b/third_party/upb/upbc/subprocess.h new file mode 100644 index 00000000000..14276d13208 --- /dev/null +++ b/third_party/upb/upbc/subprocess.h @@ -0,0 +1,99 @@ +/* + * 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. + */ + +// Shamelessly copied from the protobuf compiler's subprocess.h +// except this version passes strings instead of Messages. + +#ifndef THIRD_PARTY_UPB_UPBC_H_ +#define THIRD_PARTY_UPB_UPBC_H_ + +#ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN // right... +#endif +#include +#else // _WIN32 +#include +#include +#endif // !_WIN32 +#include + +namespace upbc { + +// Utility class for launching sub-processes. +class Subprocess { + public: + Subprocess(); + ~Subprocess(); + + enum SearchMode { + SEARCH_PATH, // Use PATH environment variable. + EXACT_NAME // Program is an exact file name; don't use the PATH. + }; + + // Start the subprocess. Currently we don't provide a way to specify + // arguments as protoc plugins don't have any. + void Start(const std::string& program, SearchMode search_mode); + + // Pipe the input message to the subprocess's stdin, then close the pipe. + // Meanwhile, read from the subprocess's stdout and copy into *output. + // All this is done carefully to avoid deadlocks. + // Returns true if successful. On any sort of error, returns false and sets + // *error to a description of the problem. + bool Communicate(const std::string& input_data, std::string* output_data, + std::string* error); + +#ifdef _WIN32 + // Given an error code, returns a human-readable error message. This is + // defined here so that CommandLineInterface can share it. + static std::string Win32ErrorMessage(DWORD error_code); +#endif + + private: +#ifdef _WIN32 + DWORD process_start_error_; + HANDLE child_handle_; + + // The file handles for our end of the child's pipes. We close each and + // set it to NULL when no longer needed. + HANDLE child_stdin_; + HANDLE child_stdout_; + +#else // _WIN32 + pid_t child_pid_; + + // The file descriptors for our end of the child's pipes. We close each and + // set it to -1 when no longer needed. + int child_stdin_; + int child_stdout_; + +#endif // !_WIN32 +}; + +} // namespace upbc + +#endif // THIRD_PARTY_UPB_UPBC_H_ diff --git a/tools/distrib/fix_build_deps.py b/tools/distrib/fix_build_deps.py index 605b885bb7f..5fed4ad27bf 100755 --- a/tools/distrib/fix_build_deps.py +++ b/tools/distrib/fix_build_deps.py @@ -166,6 +166,8 @@ EXTERNAL_DEPS = { 'libcrypto', 're2/re2.h': 're2', + 'upb/arena.h': + 'upb_lib', 'upb/def.h': 'upb_lib', 'upb/json_encode.h':